Sha256: b2445daab553966ada6d6c906e8d5af37d926d4805817ed5a3cfa465bb8396b4

Contents?: true

Size: 593 Bytes

Versions: 12

Compression:

Stored size: 593 Bytes

Contents

require 'image_optim'

class ImageOptim
  class Jpegtran < Worker
    # Copy all chunks or none (defaults to false)
    attr_reader :copy

    # Create progressive JPEG file (defaults to true)
    attr_reader :progressive

  private

    def parse_options(options)
      get_option!(options, :copy, false){ |v| !!v }
      get_option!(options, :progressive, true){ |v| !!v }
    end

    def command_args(src, dst)
      args = %W[-optimize -outfile #{dst} #{src}]
      args.unshift '-copy', copy ? 'all' : 'none'
      args.unshift '-progressive' if progressive
      args
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
image_optim-0.6.0 lib/image_optim/workers/jpegtran.rb
image_optim-0.5.1 lib/image_optim/workers/jpegtran.rb
image_optim-0.5.0 lib/image_optim/workers/jpegtran.rb
image_optim-0.4.2 lib/image_optim/workers/jpegtran.rb
image_optim-0.4.1 lib/image_optim/workers/jpegtran.rb
image_optim-0.4.0 lib/image_optim/workers/jpegtran.rb
image_optim-0.3.2 lib/image_optim/workers/jpegtran.rb
image_optim-0.3.1 lib/image_optim/workers/jpegtran.rb
image_optim-0.3.0 lib/image_optim/workers/jpegtran.rb
image_optim-0.2.1 lib/image_optim/workers/jpegtran.rb
image_optim-0.2.0 lib/image_optim/workers/jpegtran.rb
image_optim-0.1.0 lib/image_optim/workers/jpegtran.rb