我使用 carrierwave 并存储原始图像加上 3 个(我们称它们为 thumbnail
、crop_small
和 crop_big
)其他版本。 thumbnail
具有相同的比例,但尺寸更小,其他的都被裁剪了。复制版本具有相同的图像部分,但大小不同。
裁剪后(我从前端获取 x、y、宽度和高度)我只想使用新信息重新创建裁剪后的版本,因为缩略图没有改变。
这在载波中可能吗?
最佳答案
您似乎可以将参数传递给 recreate_versions!指定要重新创建的版本。
You might come to a situation where you want to retroactively change a version or add a new one. You can use the recreate_versions! method to recreate the versions from the base file. This uses a naive approach which will re-upload and process the specified version or all versions, if none is passed as an argument.
其实我也有同样的疑问,因为我以为你做不到,但事实证明你可以。
关于ruby-on-rails - 是否可以使用载波仅重新创建特定版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15199278/