Crop Image using paperclip in rails
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″
}
tnx!