end
def guess_rotate(filename)
- orientation = `exif '#{filename}'`.detect { |line| line =~ /^Orientation/ }
- if orientation =~ /right - top/
+ if $no_identify
+ return 0
+ end
+
+ orientation = `identify -format "%[EXIF:orientation]" '#{filename}'`.chomp
+ if orientation == '6'
angle = 90
- elsif orientation =~ /left - bottom/
+ elsif orientation == '8'
angle = -90
else
return 0