lib/carrierwave/processing/mini_magick.rb in locomotive_carrierwave-0.5.0.1 vs lib/carrierwave/processing/mini_magick.rb in locomotive_carrierwave-0.5.4.beta1
- old
+ new
@@ -247,14 +247,15 @@
# === Raises
#
# [CarrierWave::ProcessingError] if manipulation failed.
#
def manipulate!
- image = ::MiniMagick::Image.from_file(current_path)
+ cache_stored_file! if !cached?
+ image = ::MiniMagick::Image.open(current_path)
image = yield(image)
image.write(current_path)
- ::MiniMagick::Image.from_file(current_path)
- rescue ::MiniMagick::Error, MiniMagick::Invalid => e
+ ::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}")
end
end # MiniMagick
end # CarrierWave