代码之家  ›  专栏  ›  技术社区  ›  deb

轨道:回形针裁剪语法

  •  4
  • deb  · 技术社区  · 16 年前

    裁剪拇指时使用>或有何区别:

    例子:

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

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

    谢谢

    德伯

    2 回复  |  直到 16 年前
        1
  •  10
  •   Winfield    16 年前

    回形针在封面下使用ImageMagick,这里有一个到完整ImageMagick几何设置的链接(您将放入的内容:小缩略图定义):

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

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

    has_attached_file :image, :styles => {:small => "x100"}
    
        2
  •  0
  •   Sachin R    16 年前
    has_attached_file :photo,
      :styles => {
        :thumb=> "100x100#",
        :large =>   "400x400>" }