Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between # and > in paperclip styles for image

I have seen that in using :styles attributes in Paperclip, you ca specify sizes with #, as :thumb => "100x100#" as well as with >, as :medium => "480x320>". I am not exactly sure about the difference between the usage of # and >. Can anyone please enlighten me? Thanks.

like image 956
rookieRailer Avatar asked Aug 14 '11 02:08

rookieRailer


2 Answers

These follow the rules of formatting for ImageMagick which can be found here The > lets the image keep the same aspect ratio when it is being scaled so it doesn't get distorted.

You will not find the # key in the ImageMagick docs though, that is special to paperclip. It allows simple cropping of thumbnails to the specified size. See here for a good explanation [via Wayback Machine], about halfway down the page.

like image 100
Paul Kaplan Avatar answered Sep 30 '22 15:09

Paul Kaplan


The string you are referring to is passed to ImageMagick as a geometry string. You can read more about the possible values here: http://www.imagemagick.org/Magick++/Geometry.html

like image 33
Jake Dempsey Avatar answered Sep 30 '22 15:09

Jake Dempsey