Not Identified By ImageMagick Error when there is a space in the filename
I am getting th开发者_如何学Pythone width and height of an image stored on Amazon S3 using Paperclip as follows:
Paperclip::Geometry.from_file(user.avatar.url)
It has been working fine, but it is erroring on an image that has a space in the filename:
Paperclip::NotIdentifiedByImageMagickError: my_amazon_s3_path_is_here/Martian landslide.jpg?1294675113 is not recognized by the 'identify' command.
The image loads okay when you go to the URL in a browser. What can I do to fix this?
EDIT: Forgot to mention that images without a space in their filename work fine, so it's not an issue with Imagemagick/Paperclip setup.
Do you need to URL Encode the url's? eg replace spaces with %20
Usually when you see:
not recognized by the 'identify' command.
It means ImageMagick isn't set up correctly. Are other images working correctly?
Have you tweaked this setting yet?
Paperclip.options[:command_path] = "/opt/local/bin"
It needs to point to the location where identify is installed. From the command line, you can determine this with:
which identify
I have the same problem and file 'Снимок экрана от 2013-02-28 14:36:49.png' returns the same error. But it works correctly on heroku. So I think the problem is in ImageMagick
精彩评论