[英]Rails: Paper Clip Cropping Syntax
裁剪拇指時使用>或#有什么區別:
例:
has_attached_file :image, :styles => {:small => "100x100#"}
has_attached_file :image, :styles => {:small => "100x100>"}
如何獲得最大高度為100px但寬度可變的拇指(以保持縱橫比)?
謝謝
德布
Paperclip在封面下使用ImageMagick,這里是完整ImageMagick幾何設置的鏈接(你在你的小縮略圖定義中添加了什么):
http://www.imagemagick.org/script/command-line-processing.php#geometry
這聽起來像你想要的:“高度給定,寬度自動選擇以保持縱橫比。”
has_attached_file :image, :styles => {:small => "x100"}
has_attached_file :photo,
:styles => {
:thumb=> "100x100#",
:large => "400x400>" }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.