Search code examples
ruby-on-railsimagemagickpaperclipcropjcrop

Problem with ImageMagick while using Paperclip and Jcrop


I am using Rails 3.0.7 and I am trying to follow this Railscast: http://railscasts.com/episodes/182-cropping-images. The goal is to allow users to edit their images uploaded using PaperClip with Jcrop. However I keep getting this error:

Paperclip::NotIdentifiedByImageMagickError in Users#update

Showing /Users/skline/NutraNation1/app/views/users/crop.html.erb where line #17 raised:

/large/4/logo.png is not recognized by the 'identify' command.

This is really strange, because when I user PaperClip without Jcrop, the images load fine and ImageMagick doesn't have any problems. My development.rb file looks like this:

Paperclip.options[:command_path] = "/usr/local/bin/"

I have verified that this is indeed where Imagemagick resides. Why would Paperclip and Imagemagick work without Jcrop, but then suddenly stop working when I add the jquery plugin jcrop. Is there any other place beside devlopment.rb where I need to place the command_path???

Alternatively, does anyone know of any other way to crop files uploaded using Paperclip besides jcrop?


Solution

  • One thought could be that you are declaring a variable elsewhere. For example, if the Paperclip.options[:command_path] variable in your development.rb is declared prior to something with JCROP then it could be causing the error. I would check the readme and look at the configuration files for JCROP to see if it is declaring Paperclip.options[:command_path] somewhere else in its own files.