lib/bulldog/attachment/image.rb in bulldog-0.0.14 vs lib/bulldog/attachment/image.rb in bulldog-0.0.15
- old
+ new
@@ -50,10 +50,10 @@
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{|s| s.to_i}
- rotated = (orientation & 0x4).nonzero?
+ rotated = (5..8).include?(orientation)
@original_dimensions = rotated ? [height, width] : [width, height]
true
else
Bulldog.logger.warn "command failed (#{$?.exitstatus})"
@original_dimensions = [1, 1]