No commit activity in last 3 years
No release in over 3 years
Dragonfly processors for mozilla cjpeg and jpegtran encoders.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12

Runtime

~> 1.0
~> 0.9.6
 Project Readme

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.