How do you crop a specific area with paperclip in Rails (3)?

Posted by Smickie on Stack Overflow See other posts from Stack Overflow or by Smickie
Published on 2011-01-02T13:37:03Z Indexed on 2011/01/02 15:54 UTC
Read the original article Hit count: 220

Hi,

I have paperclip in Rails (3) working with simple cropping, for example the blow code makes a simple crop of the thumbnail:

has_attached_file :image, :styles => { :thumb => "90x90#" }, :default_style => :thumb

However I was wondering how do you crop a very specific area of an image; lets say you have an x and y coordinate to start from and then a width and height of the crop.

How do you go about passing a complex style like this in?

Thanks very much.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about imagemagick