, as :medium => \"480x320>\". I am not exactly" />
开发者

Difference between # and > in paperclip styles for image

I have s开发者_JS百科een 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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜