如何将缩略图生成规则从回形针转换为载波
我正在从 Paperclip 迁移到 Carrierwave。这里我尝试转换缩略图生成的处理命令:
has_attached_file :image,
styles: {
thumb: '220x140#',
big: '620x600>',
no_proportion: '255x162!'
},
convert_options: {
all: '-strip',
thumb: '-delete 1--1',
no_proportion: '-delete 1--1'
}
我计划使用MiniMagick。我发现我从 220x140#
转换为 resize_to_fill(220,140)
,但我不确定如何转换所有其他命令。
PS 如果我可以重用现有的 ImageMagick 命令和参数,甚至用于调整大小(即不使用内置帮助程序调整器),那就更好了。
I am migrating from Paperclip to Carrierwave. Here I am trying to convert the processing commands for thumbnail generations:
has_attached_file :image,
styles: {
thumb: '220x140#',
big: '620x600>',
no_proportion: '255x162!'
},
convert_options: {
all: '-strip',
thumb: '-delete 1--1',
no_proportion: '-delete 1--1'
}
I am planning to use MiniMagick. I got that I convert from 220x140#
to resize_to_fill(220,140)
, but I am not sure how to convert all the other commands.
P.S. It would be better if I can reuse the existing ImageMagick commands and parameters, even for resizing (i.e. not using built-in helper resizer).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了以下事情。但我不确定它是否完全等效。
I have done the following. However I am not sure if it is totally equivalent.