【发布时间】:2013-10-11 22:13:18
【问题描述】:
我需要将图像的尺寸保存在我的数据库中,以帮助我以 pinterest 风格的画廊格式呈现图像。
我曾经有过这种方法:
def update_asset_attributes
if image.present? && image_changed?
ap image.file
self.image_content_type = image.file.content_type
self.image_file_size = image.file.size
self.image_width, self.image_height = `identify -format "%wx%h" #{image.file.path}`.split(/x/)
end
end
但现在它说:NoMethodError - undefined method content_type for #<Cloudinary::CarrierWave::PreloadedCloudinaryFile:0x007f9834d81840>:
【问题讨论】:
标签: cloudinary