Reputation: 1985
I am running Paperclip 2.3.11 and ImageMagick 6.7.1-1. I am uploading images to an Amazon S3 account.
If I upload a .png
file it works fine, if I upload a .jpg
it does not.
This is the error generated in my view when I try uploading a jpg:
3 errors prohibited this post from being saved:
Photo /var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/stream20110817-6147-urdz8d-0.jpg is not recognized by the 'identify' command.
Photo /var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/stream20110817-6147-urdz8d-0.jpg is not recognized by the 'identify' command.
Photo /var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/stream20110817-6147-urdz8d-0.jpg is not recognized by the 'identify' command.
And my log reads:
Started POST "/posts" for 127.0.0.1 at Wed Aug 17 20:35:12 -0400 2011
Processing by PostsController#create as HTML
Parameters: {"commit"=>"Create Post", "post"=>{"photo"=>#<ActionDispatch::Http::UploadedFile:0x10c64d900 @headers="Content-Disposition: form-data; name=\"post[photo]\"; filename=\"Stonehenge.jpg\"\r\nContent-Type: image/jpeg\r\n", @content_type="image/jpeg", @original_filename="Stonehenge.jpg", @tempfile=#<File:/var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/RackMultipart20110817-6147-1uad809-0>>, "title"=>"test", "description"=>"test"}, "authenticity_token"=>"V/EinZAi2NNYx7AokikTpQFkNtADNiauW5vcNGdhTug=", "utf8"=>"\342\234\223"}
[paperclip] identify -format %wx%h '/var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/stream20110817-6147-urdz8d-0.jpg[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /var/folders/k9/kw7hkdmx741cqrc1h6_qwc580000gp/T/stream20110817-6147-urdz8d-0.jpg is not recognized by the 'identify' command.>
Has anyone encountered this before? Let me know if any other info would be helpful.
UPDATE: Just noticed that .jpg files do upload fine on a different computer (both are Macs running 10.6/10.7 respectively). This leaves me even more lost. What could be misconfigured on my other machine?
Upvotes: 1
Views: 867
Reputation: 1985
Finally got this fixed. Based on @floor's answer. ImageMagick did not have jpg support on this machine. I had to uninstall and reinstall, then uninstall and reinstall Rmagick as well. Everything is working now.
Upvotes: 0
Reputation: 83680
You should install JPG support for ImageMagick.
http://www.randycullom.com/chatterbox/archives/2006/12/installing_imag.html
Here is jpegsrc and other sources for ImageMagick:
Upvotes: 1