Rails CarrierWave 图片格式转换问题

lukefan · January 14, 2014 · Last by lukefan replied at January 18, 2014 · 2732 hits

我在 uploader 里面添加了代码:

include CarrierWave::RMagick
process :convert => 'png'

希望将所有上传的图片,都转换成 png 格式。结果发现不起作用,上传的 jpg,依然是 jpg。 另外,现在 rmagick 已经支持 webp 了。

require 'RMagick'
p = Magick::Image.read('UXonxMRY.jpg').first
p.write('UXonxMRY.webp')

但是,如果使用:

include CarrierWave::RMagick
process :convert => 'webp'

这个却总是不能够成功。

也尝试了 carrierwave-webp,里面的 webp-ffi,无法编译成功。 我在 mac 和 centos 上都没有搞定。

我到底遇到了什么问题? 请各位大神们帮忙看看。

You need to Sign in before reply, if you don't have an account, please Sign up first.