Class: ImageOptim::Worker::Pngout

Inherits:
ImageOptim::Worker show all
Defined in:
lib/image_optim/worker/pngout.rb

Overview

Constant Summary collapse

COPY_CHUNKS_OPTION =
option(:copy_chunks, false, 'Copy optional chunks'){ |v| !!v }
STRATEGY_OPTION =
option(:strategy, 0, 'Strategy: '\
    '`0` - xtreme, '\
    '`1` - intense, '\
    '`2` - longest Match, '\
    '`3` - huffman Only, '\
    '`4` - uncompressed') do |v|
  OptionHelpers.limit_with_range(v.to_i, 0..4)
end

Instance Method Summary collapse

Methods inherited from ImageOptim::Worker

#<=>, bin_sym, #image_formats, inherited, #initialize, klasses, #optimized?, option, option_definitions

Constructor Details

This class inherits a constructor from ImageOptim::Worker

Instance Method Details

#optimize(src, dst) ⇒ Object



26
27
28
29
# File 'lib/image_optim/worker/pngout.rb', line 26

def optimize(src, dst)
  args = %W[-k#{copy_chunks ? 1 : 0} -s#{strategy} -q -y #{src} #{dst}]
  execute(:pngout, *args) && optimized?(src, dst)
end

#run_orderObject

Always run first [-1]



22
23
24
# File 'lib/image_optim/worker/pngout.rb', line 22

def run_order
  -1
end