Oil resizes JPEG and PNG images
C Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ext/oil
lib
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.rdoc
Rakefile

README.rdoc

Oil

github.com/ender672/oil

DESCRIPTION:

Oil is a Ruby extension for resizing JPEG and PNG images. It aims for fast performance and low memory use.

INSTALLATION:

$ gem install oil

SYNOPSIS:

require 'oil'

# Oil uses IO objects for input & output.
io_in = File.open('image.jpg', 'rb')
io_out = File.open('image_resized.jpg', 'w')

# Read the source image header and prepare to fit it into a 200x300 box.
img = Oil.new(io_in, 200, 300)

# Write the resized image to disk
img.each { |data| io_out << data }

REQUIREMENTS:

* libjpeg-turbo
* libpng

Installing libjpeg and libpng headers (Debian/Ubuntu):

$ sudo apt-get install libjpeg-dev libpng-dev

COMPILING & TESTING:

Compile & run unit tests. Should show no warnings and no failing tests:

$ rake compile
$ rake test

Valgrind should not complain (ruby-1.9.3p125, compiled with -O3):

$ valgrind /path/to/ruby -Iext:test test/test_jpeg.rb
$ valgrind /path/to/ruby -Iext:test test/test_png.rb

Changes to the interpolator should be analyzed using ResampleScope:

https://github.com/jsummers/resamplescope