Class: ImageOptim::Worker::Jhead
- Inherits:
-
ImageOptim::Worker
- Object
- ImageOptim::Worker
- ImageOptim::Worker::Jhead
- Defined in:
- lib/image_optim/worker/jhead.rb
Overview
www.sentex.net/~mwandel/jhead/
Jhead internally uses jpegtran which should be on path
Constant Summary collapse
- ORIENTED =
not top-left
(2..8).freeze
Instance Method Summary collapse
-
#image_formats ⇒ Object
Works on jpegs.
- #optimize(src, dst, options = {}) ⇒ Object
-
#run_order ⇒ Object
Run first, while exif is still present.
- #used_bins ⇒ Object
Methods inherited from ImageOptim::Worker
#initialize, #inspect, #optimized?, #options, #resolve_used_bins!
Methods included from ClassMethods
#bin_sym, #create_all, #create_all_by_format, extended, #inherited, #klasses, #option, #option_definitions
Constructor Details
This class inherits a constructor from ImageOptim::Worker
Instance Method Details
#image_formats ⇒ Object
Works on jpegs
15 16 17 |
# File 'lib/image_optim/worker/jhead.rb', line 15 def image_formats [:jpeg] end |
#optimize(src, dst, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/image_optim/worker/jhead.rb', line 28 def optimize(src, dst, = {}) return false unless oriented?(src) src.copy(dst) args = %W[ -autorot #{dst} ] resolve_bin!(:jpegtran) execute(:jhead, args, ) && dst.size? end |
#run_order ⇒ Object
Run first, while exif is still present
20 21 22 |
# File 'lib/image_optim/worker/jhead.rb', line 20 def run_order -10 end |
#used_bins ⇒ Object
24 25 26 |
# File 'lib/image_optim/worker/jhead.rb', line 24 def used_bins [:jhead, :jpegtran] end |