Sha256: a85f4495d1a599dabf692171c8ccd548eac3a8579d1952559a013c0a786f0fd3
Contents?: true
Size: 762 Bytes
Versions: 15
Compression:
Stored size: 762 Bytes
Contents
require 'image_optim/worker' require 'image_optim/option_helpers' class ImageOptim class Worker # http://advancemame.sourceforge.net/doc-advpng.html class Advpng < Worker LEVEL_OPTION = option(:level, 4, 'Compression level: '\ '`0` - don\'t compress, '\ '`1` - fast, '\ '`2` - normal, '\ '`3` - extra, '\ '`4` - extreme') do |v| OptionHelpers.limit_with_range(v.to_i, 0..4) end def run_order 4 end def optimize(src, dst) src.copy(dst) args = %W[ --recompress -#{level} --quiet -- #{dst} ] execute(:advpng, *args) && optimized?(src, dst) end end end end
Version data entries
15 entries across 15 versions & 3 rubygems