Class ImageScience
In: lib/image_science.rb
Parent: Object

Provides a clean and simple API to generate thumbnails using FreeImage as the underlying mechanism.

For more information or if you have build issues with FreeImage, see seattlerb.rubyforge.org/ImageScience.html

Methods

Constants

VERSION = '1.2.1'

Public Class methods

The top-level image loader opens path and then yields the image.

The top-level image loader, opens an image from the string data and then yields the image.

Public Instance methods

Creates a square thumbnail of the image cropping the longest edge to match the shortest edge, resizes to size, and yields the new image.

Returns the height of the image, in pixels.

Resizes the image to width and height using a cubic-bspline filter and yields the new image.

Saves the image out to path. Changing the file extension will convert the file type to the appropriate format.

Creates a proportional thumbnail of the image scaled so its longest edge is resized to size and yields the new image.

Returns the width of the image, in pixels.

Crops an image to left, top, right, and bottom and then yields the new image.

[Validate]