4

Im using Paperclip to size my images but I keep getting this error

( 1 error prohibited this project from being saved: Image C:/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/stream,5584,0.jpg is not recognized by the 'identify' command. )

Ive tried pretty much everything that I found online:

  • Adding Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16" to my development.rb
  • Doing changes to the project.rb (removing single quotes)

I'm running windows with the latest Ruby/Rails and Paperclip 1.3.3

Im just getting into Rails and I have no idea what to do. I know this is a common problem but all of the answers I have come across havent helped.

Thanks in advance.

ChrisBedoya
  • 737
  • 2
  • 15
  • 28

2 Answers2

1

I was able to get this to work on Windows XP (my dev environment - deployment to Heroku worked fine) by doing the following:

  1. Installing ImageMagick to c:\ImageMagick
  2. editing config/environments/development.rb and adding the following

    Paperclip.options[:command_path] = "C:/ImageM~1"

  3. Kill and restart the dev server to pick up the new config.

I was not able to get it to work by using "long" windows paths. Only the '~1' monstrosity. So, the only thing you might have to do is change

Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16"

to

Paperclip.options[:command_path] = "C:/ImageM~1"
Edward M Smith
  • 10,627
  • 2
  • 46
  • 50
  • Tried it but it still didnt work. I even reinstalled Imagemagick but nothing. Thanks for the help. Does it matter where you put the code inside of development.rb? – ChrisBedoya Dec 03 '10 at 21:38
  • I don't think so. Mine is at the end. I think your issue might be something to do with what your temp files are called. You're question shows "C:/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/stream,5584,0.jpg". When you upload a file, if you check in directory specified in the log, what do you see for a filename? When i had the issue, this is what my filename looked like: "C:/DOCUME~1/EDWARD~1/LOCALS~1/temp/stream20101108-5012-95s03z.jpg[0]" – Edward M Smith Dec 03 '10 at 22:06
  • I checked the temp folder and the name of the image I tried to upload is stream,5584,0.jpg. – ChrisBedoya Dec 04 '10 at 19:11
1

I was able to get it working more or less in the same way as Edward, with some additions:

  1. Installing ImageMagick to c:\Imagick6 -> chose this path to have a folder name of not more than 8 chars
  2. If you have a previous version, make sure that you remove that old version from the path and that c:\Imagick6 is in your Windows path (check with "echo %path%" on prompt)
  3. edit config/environments/development.rb and add:
    Paperclip.options[:command_path] = "C:/Imagick6"
  4. Kill and restart the dev server to pick up the new config
  5. You might even need to restart Windows to make sure the new path is picked up (I did, could not verify whether that helped)
Pascal Van Hecke
  • 4,516
  • 3
  • 19
  • 18