public
Description: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.
Home | Edit | New

OperatorCrop

crop(options = {})

Crops the image without doing any resizing first. The operation crops from the :from coordinate, and returns an image of size :size down and right from there.

Use the following keys in the options hash:

  • :from
    Coordinates for the upper left corner of resulting image.
  • :size
    The size of the resulting image, going down and to the right of the :from coordinate.

Both options are required.

Example

@photo.operate do |image|
  image.crop(
    :from => '100x50',
    :size => '500x350'
  )
end

Back to Operators

Last edited by Squeegy, Fri Apr 04 14:30:07 -0700 2008
Home | Edit | New
Versions: