lib/bulldog/attachment/image.rb in bulldog-0.0.13 vs lib/bulldog/attachment/image.rb in bulldog-0.0.14

- old
+ new

@@ -17,11 +17,11 @@ def dimensions(style_name) if style_name.equal?(:original) from_examination :original_dimensions else style = reflection.styles[style_name] - target_dimensions = style[:size].split(/x/).map(&:to_i) + target_dimensions = style[:size].split(/x/).map{|s| s.to_i} resized_dimensions(dimensions(:original), target_dimensions, style[:filled]) end end include HasDimensions @@ -49,10 +49,10 @@ @original_dimensions = [1, 1] false else output = `identify -format "%w %h %[exif:Orientation]" #{stream.path} 2> /dev/null` if $?.success? && output.present? - width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map(&:to_i) + width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map{|s| s.to_i} rotated = (orientation & 0x4).nonzero? @original_dimensions = rotated ? [height, width] : [width, height] true else Bulldog.logger.warn "command failed (#{$?.exitstatus})"