Skip to content
Squeegy edited this page Sep 12, 2010 · 2 revisions

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

Clone this wiki locally