Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: Paper Clip Cropping Syntax

What is the difference between using > or # when cropping a thumb:

example:

has_attached_file :image, :styles => {:small => "100x100#"}


has_attached_file :image, :styles => {:small => "100x100>"}

How do get a thumb that has the maxium height of 100px but variable width (to preserve the aspect ratio)?

Thanks

Deb

like image 573
deb Avatar asked Dec 29 '22 10:12

deb


1 Answers

Paperclip uses ImageMagick under the covers, here's a link to the full ImageMagick geometry settings (what you're putting in your :small thumbnail definitions):

http://www.imagemagick.org/script/command-line-processing.php#geometry

It sounds like you want: "Height given, width automagically selected to preserve aspect ratio."

has_attached_file :image, :styles => {:small => "x100"}
like image 198
Winfield Avatar answered Jan 14 '23 13:01

Winfield