【发布时间】:2016-07-10 11:41:15
【问题描述】:
我有一个常规的文件上传,现在我改为使用 Cloudinary。
在上传时,我做了以下操作,以防止从移动设备上传图像时出现方向故障(有关详细信息,请参阅 exif image rotation issue using carrierwave and rmagick to upload to s3):
process :rotate
process :store_dimensions
def rotate
manipulate! do |image|
image.tap(&:auto_orient)
end
end
def store_dimensions
# This does not work with cloudinary #18
if file && model
model.width, model.height = ::MiniMagick::Image.open(file.file)[:dimensions]
end
end
旋转和存储尺寸都不起作用,因为我切换到 cloudinary。
现在 Cloudinary 有 an official tutuorial 来展示如何做到这一点,但它根本不起作用,其他人似乎也有同样的问题,而且提供的选项都不适合我:
【问题讨论】:
标签: ruby-on-rails imagemagick carrierwave cloudinary minimagick