class ImageOptim::Worker::Jpegtran
Uses jpegtran through jpegrescan if enabled, jpegrescan is vendored with this gem
Constants
- COPY_CHUNKS_OPTION
- JPEGRESCAN_OPTION
- PROGRESSIVE_OPTION
Public Instance Methods
optimize(src, dst)
click to toggle source
# File lib/image_optim/worker/jpegtran.rb, line 24 def optimize(src, dst) if jpegrescan args = %W[ #{src} #{dst} ] args.unshift '-s' unless copy_chunks resolve_bin!(:jpegtran) execute(:jpegrescan, *args) && optimized?(src, dst) else args = %W[ -optimize -outfile #{dst} #{src} ] args.unshift '-copy', (copy_chunks ? 'all' : 'none') args.unshift '-progressive' if progressive execute(:jpegtran, *args) && optimized?(src, dst) end end
used_bins()
click to toggle source
# File lib/image_optim/worker/jpegtran.rb, line 20 def used_bins jpegrescan ? [:jpegtran, :jpegrescan] : [:jpegtran] end