简体   繁体   English

Rails4 - 回形针样式中#和>的含义是什么?

[英]Rails4 - What is the meaning of # and > in paperclip styles?

What is the meaning of # and > in the following? 以下#和>的含义是什么?

has_attached_file :avatar, 
:styles => {
  :thumb    => ['100x100#',  :jpg, :quality => 70],
  :preview  => ['480x480#',  :jpg, :quality => 70],
  :large    => ['600>',      :jpg, :quality => 70],
  :retina   => ['1200>',     :jpg, :quality => 30]
},

As stays on the official wiki: 作为官方维基的留言:

  • trailing # , thumbnail will be centrally cropped, ensuring the requested dimensions. 尾随# ,缩略图将被集中裁剪,确保所需的尺寸。
  • trailing > , thumbnail will only be modified if it is currently larger requested dimensions. trailing > ,缩略图只有在当前较大的请求尺寸时才会被修改。 (ie the :small thumb for a 120×80 original image will be unchanged) (即: 120×80原始图像的小拇指将保持不变)

https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation

Paperclip uses ImageMagick to process the images. Paperclip使用ImageMagick处理图像。 From their docs : 从他们的文档

Use > to shrink an image only if its dimension(s) are larger than the corresponding width and/or height arguments. 仅当图像的尺寸大于相应的宽度和/或高度参数时,才使用>缩小图像。

As blelump mentioned you should also the the paperclip docs 正如blelump所提到的,你也应该使用回形针文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM