开发者

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 开发者_JS百科do get a thumb that has the maxium height of 100px but variable width (to preserve the aspect ratio)?

Thanks

Deb


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"}


has_attached_file :photo,
  :styles => {
    :thumb=> "100x100#",
    :large =>   "400x400>" }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜