Skip to content

jurema/dragonfly_mozjpeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dragonfly mozjpeg

Plugin for mozilla's cjpeg and jpegtran encoders for dragonfly.

Installation

Add this line to your application's Gemfile:

gem 'dragonfly_mozjpeg'

And then execute:

$ bundle

Or

$ gem install dragonfly_mozjpeg

Usage

Dragonfly.app.configure do
  plugin :mozjpeg
end

Overwrite default binaries, For example:

Dragonfly.app.configure do
  plugin :mozjpeg,
    cjpeg:    '/opt/mozjpeg/bin/cjpeg',
    jpegtran: '/opt/mozjpeg/bin/jpegtran'
end

Processors

Lossy

Lossy compression with cjpeg, and you can pass cjpeg options. For example:

image.lossy([:noovershoot, quality: "70,60", sample: "2x2", smooth: 10])

Lossless

Lossless compression with jpegtran, jpegtran and you can pass options, For example:

image.lossless([:grayscale, :trim, copy: :none, flip: :horizontal])

Contributing

Bug reports and pull requests are welcome at https://github.com/jurema/dragonfly_mozjpeg.

License

This gem is available as open source under the terms of the MIT License, see LICENSE.txt.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published