Rails:Paper Clip Cropping Syntax

deb*_*deb 4 ruby-on-rails paperclip

裁剪拇指时使用>或#有什么区别:

例:

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


has_attached_file :image, :styles => {:small => "100x100>"}
Run Code Online (Sandbox Code Playgroud)

如何获得最大高度为100px但宽度可变的拇指(以保持纵横比)?

谢谢

德布

Win*_*eld 10

Paperclip在封面下使用ImageMagick,这里是完整ImageMagick几何设置的链接(你在你的小缩略图定义中添加了什么):

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

这听起来像你想要的:"高度给定,宽度自动选择以保持纵横比."

has_attached_file :image, :styles => {:small => "x100"}
Run Code Online (Sandbox Code Playgroud)