2
votes

I'm trying to upload some photos into my Rails app. But I'm getting:

Paperclip::NotIdentifiedByImageMagickError in Admin::ImagesController#create

C:/Users/Dwayne/stream20110816-3680-1hm9dag-0.jpeg is not recognized by the 'identify' command.

I know this has been asked before. I thought I'd give my side of the story though, be a bit more verbose than the others, and in doing so help increase awareness of this terrible tragedy.

What platform are you on?

# uname
CYGWIN_NT-6.1-WOW64

Is ImageMagick installed?

# identify
Version: ImageMagick 6.4.0 01/19/10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Where is it?

# which identify
/usr/bin/identify

Tell that to Paperclip:

# config/environments/development.rb
Paperclip.options[:command_path] = "/usr/bin"

See if all the files and folders work:

# identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb

# identify /cygdrive/c/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb

Try the same from within the Rails console:

# irb(main):005:0> system("identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg")
C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg JPEG 360x360 360x360+0+0 DirectClass 8-bit 32.3281kb
=> true

Still nothing?

Take it to Paperclip's GitHub.

Still nothing?

Hope that somebody here might know.

1
Can you make a copy of the file available? - Keith Thompson
Suggestion: Install a Windows Version of Image Magick (Binary) use an editor like Aptana with a Git Bash. Make Sure Image Magick is installed in the Windows PATH remove Paperclip.options[:command_path] = "/usr/bin" as it won't be necessary with it in the path and try again. If there is no error it has something to do with the Cygwin ImageMagick if not it may be somewhere else. - Travis Pessetto
Travis, you did it man! Bless you and all your offspring! - Badgeman 3000

1 Answers

0
votes

Courtesy of Travis Pessetto:

Uninstall ImageMagick for Cygwin, install ImageMagick for Windows and try again!