Crop Image using paperclip in rails

Categories Ruby On Rails
1

In models file,

I used the following ImageMagick options to make it centered: background color,gravity and extent.

has_attached_file :photo,
:styles => {  :slider =>”480×330″, :medium => “270×250″, :thumb => “85×75″ },
:convert_options => {
:slider =>”-background ‘#C7CCD2′ -compose Copy -gravity center -extent 480×330″,
:medium => “-background ‘#C7CCD2′ -compose Copy -gravity center -extent 270×250″,
:thumb => “-background ‘#C7CCD2′ -compose Copy -gravity center -extent 85×75″
}

One thought on “Crop Image using paperclip in rails

Leave a Reply

Your email address will not be published. Required fields are marked *

*


8 + = thirteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>