lib/sinatra/assetpack/image.rb in sinatra-assetpack-0.0.12.pre1 vs lib/sinatra/assetpack/image.rb in sinatra-assetpack-0.1.0
- old
+ new
@@ -28,11 +28,11 @@
end
def dimensions
return @dimensions unless @dimensions.nil?
- _, _, dim = `identify "#{@file}"`.split(' ')
- w, h = dim.split('x')
+ dim = /(\d+) x (\d+)/.match(`file "#{@file}"`)
+ w, h = dim[1,2]
if w.to_i != 0 && h.to_i != 0
@dimensions = [w.to_i, h.to_i]
else
@dimensions = false