lib/carrierwave/processing/mini_magick.rb in carrierwave-0.5.7 vs lib/carrierwave/processing/mini_magick.rb in carrierwave-0.5.8
- old
+ new
@@ -30,20 +30,19 @@
# info
#
# class MyUploader < CarrierWave::Uploader::Base
# include CarrierWave::MiniMagick
#
- # process :do_stuff => 10.0
+ # process :radial_blur => 10
#
- # def do_stuff(blur_factor)
+ # def radial_blur(amount)
# manipulate! do |img|
- # img = img.sepiatone
- # img = img.auto_orient
- # img = img.radial_blur blur_factor
+ # img.radial_blur(amount)
+ # img = yield(img) if block_given?
+ # img
# end
# end
- # end
#
# === Note
#
# MiniMagick is a mini replacement for RMagick that uses the command line
# tool "mogrify" for image manipulation.
@@ -244,10 +243,10 @@
image = ::MiniMagick::Image.open(current_path)
image = yield(image)
image.write(current_path)
::MiniMagick::Image.open(current_path)
rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
- raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
+ raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e)
end
end # MiniMagick
end # CarrierWave