lib/carrierwave/processing/rmagick.rb in carrierwave-2.2.6 vs lib/carrierwave/processing/rmagick.rb in carrierwave-3.0.0.beta
- old
+ new
@@ -107,11 +107,11 @@
#
# See even http://www.imagemagick.org/RMagick/doc/magick.html#formats
#
# === Parameters
#
- # [format (#to_s)] an abreviation of the format
+ # [format (#to_s)] an abbreviation of the format
#
# === Yields
#
# [Magick::Image] additional manipulations to perform
#
@@ -361,18 +361,18 @@
write_block = create_info_block(options[:write])
if options[:format] || @format
frames.write("#{options[:format] || @format}:#{current_path}", &write_block)
move_to = current_path.chomp(File.extname(current_path)) + ".#{options[:format] || @format}"
- 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)
else
frames.write(current_path, &write_block)
end
destroy_image(frames)
- rescue ::Magick::ImageMagickError => e
- raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.rmagick_processing_error", :e => e)
+ rescue ::Magick::ImageMagickError
+ raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.processing_error")
end
private
def create_info_block(options)