我正在使用Paperclip来允许用户上传图片,并且只有当图片是tiff格式时,我希望将其转换为jpg / png。
以下是我在image.rb中使用的代码:
validates_attachment_presence :data
validates_attachment_content_type :data,
:content_type => ['image/jpeg', 'image/pjpeg',
'image/jpg', 'image/png', 'image/tif', 'image/gif'], :message => "has to be in a proper format"
我想知道在上传时是否可以将tiff图像转换为jpg或png格式。谢谢。