I need to implement an image cropping feature on user uploaded avatars. The ever gold RailsCasts episode shows us the way.
All sweet stuff, until
MiniMagick tells me it’s
mogrify shell command cannot find the image resource. Backtrace points to
image.crop(x, y, w, h) line. After some messing around and examining the MiniMagick source. Here’s the fix.
Problem solved by changing the
image.crop method argument from
x, y, w, h to an interpolated string that complies to Imagemagick’s geometry format spec.
EDIT: while writing this post, I found the exact solution has been mentioned on RailsCasts episode’s comments section. Damn, I want my time back :`(