我使用回形針允許用戶上傳圖像,並且只有在圖像爲tiff圖像時纔會將圖像轉換爲jpg/png 。回形針 - 將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。
非常感謝