class ImageOptim::Worker::Pngcrush
Constants
- BLACKEN_OPTION
- BRUTE_OPTION
- CHUNKS_OPTION
- FIX_OPTION
Public Instance Methods
optimize(src, dst, options = {})
click to toggle source
# File lib/image_optim/worker/pngcrush.rb, line 31 def optimize(src, dst, options = {}) flags = %w[ -reduce -cc -q ] chunks.each do |chunk| flags.push '-rem', chunk end flags.push '-fix' if fix flags.push '-brute' if brute if blacken && resolve_bin!(:pngcrush).version >= '1.7.38' flags.push '-blacken' end args = flags + %W[ -- #{src} #{dst} ] execute(:pngcrush, args, options) && optimized?(src, dst) end
run_order()
click to toggle source
# File lib/image_optim/worker/pngcrush.rb, line 27 def run_order -6 end