Just in case, if anyone uses Carrierwave to crop and upload the image directly to Amazon S3, the right way to do this for me is:
image_uploader.rb
url=model.remote_image_url crop_params="#{w}x#{h}+#{x}+#{y}" manipulate! do |img| img = MiniMagick::Image.open(url) img.crop(crop_params) img = yield(img) if block_given? img end
The reason I add img = MiniMagick :: Image.open (url) is because if I donβt specify my own image, it will cause me an error:
mogrify.im6: geometry does not contain image `/tmp/mini_magick20150811-15523-ac8go1.jpeg'
I think this is the default temporary path that mini_magick will try to find the image, but since the image is stored remotely in S3, it cannot find it.
Antonio jha
source share