lib/image_optim/worker/jhead.rb in image_optim-0.22.0 vs lib/image_optim/worker/jhead.rb in image_optim-0.22.1
- old
+ new
@@ -5,10 +5,12 @@
class Worker
# http://www.sentex.net/~mwandel/jhead/
#
# Jhead internally uses jpegtran which should be on path
class Jhead < Worker
+ ORIENTED = 2..8 # not top-left
+
# Works on jpegs
def image_formats
[:jpeg]
end
@@ -34,10 +36,10 @@
private
def oriented?(image)
exif = EXIFR::JPEG.new(image.to_s)
- (2..8).include?(exif.orientation.to_i)
+ ORIENTED.include?(exif.orientation.to_i)
end
end
end
end