0.0
No commit activity in last 3 years
No release in over 3 years
Jpegtran provides Ruby interface to the jpegtran tool
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 0
~> 10.0
~> 3.0
 Project Readme

Jpegtran

Provides Ruby interface to the jpegtran tool.

Travis CI

Installation

Add this line to your application's Gemfile:

gem 'jpegtran-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jpegtran-ruby

This gem uses jpegtran executable. So it needs to be installed on the machine.
Usually it comes with the libjpeg or you can use MozJPEG.

Usage

require "jpegtran"

Jpegtran.configured? # will return true (or false)

options = { progressive: true, optimize: true }
Jpegtran.optimize("foo.jpg", options) # will run `jpegtran -progressive -optimize -outfile foo.jpg foo.jpg`

Note that -maxmemory N option isn't supported.

Configuring

Jpegtran.configure do |config|
  config.executable = "/usr/local/bin/jpegtran"
end

Copyright

Copyright © 2011 – 2016 Martin Poljak