lib/image_optim/worker/optipng.rb in image_optim-0.20.2 vs lib/image_optim/worker/optipng.rb in image_optim-0.21.0

- old
+ new

@@ -19,18 +19,26 @@ '`false` - interlace off, '\ '`nil` - as is in original image') do |v| TrueFalseNil.convert(v) end + STRIP_OPTION = + option(:strip, true, 'Remove all auxiliary chunks'){ |v| !!v } + + def run_order + -4 + end + def optimize(src, dst) src.copy(dst) args = %W[ -o #{level} -quiet -- #{dst} ] args.unshift "-i#{interlace ? 1 : 0}" unless interlace.nil? + args.unshift '-strip', 'all' if strip execute(:optipng, *args) && optimized?(src, dst) end end end end