“识别”无法识别图像命令
我正在尝试将一些照片上传到我的 Rails 应用程序中。但我得到的答案是:
Paperclip::NotIdentifiedByImageMagickError in Admin::ImagesController#create
C:/Users/Dwayne/stream20110816-3680-1hm9dag-0.jpeg is not recognized by the 'identify' command.
我知道以前已经有人问过这个问题了。我想我应该给出我自己的故事,比其他人更详细一点,这样做有助于提高人们对这场可怕悲剧的认识。
你在什么平台?
# uname
CYGWIN_NT-6.1-WOW64
是否安装了 ImageMagick?
# identify
Version: ImageMagick 6.4.0 01/19/10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
它在哪里?
# which identify
/usr/bin/identify
告诉 Paperclip:
# config/environments/development.rb
Paperclip.options[:command_path] = "/usr/bin"
看看所有文件和文件夹是否工作:
# 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
在 Rails 控制台中尝试相同的操作:
# 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
仍然没有任何结果?
将其带到 Paperclip 的 GitHub。
还是什么都没有?
希望这里有人知道。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由 Travis Pessetto 提供:
卸载适用于 Cygwin 的 ImageMagick,安装适用于 Windows 的 ImageMagick,然后重试!
Courtesy of Travis Pessetto:
Uninstall ImageMagick for Cygwin, install ImageMagick for Windows and try again!