lib/carrierwave/processing/vips.rb in carrierwave-2.2.6 vs lib/carrierwave/processing/vips.rb in carrierwave-3.0.0.beta
- old
+ new
@@ -257,14 +257,14 @@
FileUtils.mv result.path, current_path
if File.extname(result.path) != File.extname(current_path)
move_to = current_path.chomp(File.extname(current_path)) + File.extname(result.path)
- file.content_type = ::MiniMime.lookup_by_filename(move_to).content_type
+ file.content_type = Marcel::Magic.by_path(move_to).try(:type)
file.move_to(move_to, permissions, directory_permissions)
end
- rescue ::Vips::Error => e
- message = I18n.translate(:"errors.messages.vips_processing_error", :e => e)
+ rescue ::Vips::Error
+ message = I18n.translate(:"errors.messages.processing_error")
raise CarrierWave::ProcessingError, message
end
private