开发者

Image not recognized by the 'identify' command

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/D开发者_运维技巧wayne/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.


Courtesy of Travis Pessetto:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜