ruby-on-rails - 是否可以使用载波仅重新创建特定版本?

标签 ruby-on-rails ruby

我使用 carrierwave 并存储原始图像加上 3 个(我们称它们为 thumbnailcrop_smallcrop_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/

相关文章:

ruby-on-rails - Heroku 页面 :push Can't get Database URL working

ruby - 来自数据库的字符串中的 Rails 字符串插值

ruby - 循环后删除空行

ruby-on-rails - 改变 Ruby 中的调用对象

ruby-on-rails - ActiveRecord SQL执行时间

ruby-on-rails - 为什么 Chrome 在使用 POW 时渲染 Rails 页面这么慢?

ruby-on-rails - 在 Rails 4 中向模型和强参数添加注释会引发错误

android - 通过 Rails API 使用 Facebook 进行身份验证

ruby - 如何使用 Shopify Plus 脚本编辑器应用限制产品/变体数量?

ruby - 液体标准默认过滤器不显示默认值