【问题标题】:Carrierwave, is it possible to load images into manipulate?Carrierwave,是否可以将图像加载到操纵中?
【发布时间】:2023-03-14 08:37:02
【问题描述】:

是否可以将图像加载到操作中!在 Carrierwave 上传器中屏蔽?

例如:

process :cover
def cover
  manipulate! do |img|
  # interesting manipulation code
  img = Magick::Image::read("#{Rails.root}/tmp/doc.jpg").first
  img
end

谢谢, 亚历克斯

【问题讨论】:

    标签: ruby-on-rails ruby imagemagick carrierwave


    【解决方案1】:

    是的,你可以。查看代码herehere 了解详细信息。

    不要忘记手动销毁传递的图像以释放资源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      • 2011-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-18
      相关资源
      最近更新 更多