ruby on rails - PaperClip gem Paperclip::Errors::NotIdentifiedByImageMagickError -
there numerous stackoverflow questions regarding this, after many hours, i've exhausted every angle think of, , still following error when try upload image using paperclip gem (in tandem papercrop, cropping image).
paperclip::errors::notidentifiedbyimagemagickerror - paperclip::errors::notidentifiedbyimagemagickerror: paperclip (4.3.6) lib/paperclip/geometry_detector_factory.rb:10:in `make' paperclip (4.3.6) lib/paperclip/geometry.rb:26:in `from_file' papercrop (0.3.0) lib/papercrop/model_extension.rb:95:in `image_geometry' papercrop (0.3.0) lib/papercrop/helpers.rb:45:in `cropbox' app/views/users/_crop_photo_modal.html.haml:12:in `block in _app_views_users__crop_photo_modal_html_haml___1410212035753490924_70365684359680'
here prints in logs prior error:
[aws s3 200 0.554305 0 retries] head_object(:bucket_name=>"xxx-development-bucket-us",:key=>"profiles/profile_images/1/original/main_sized_small.png") [aws s3 200 0.049585 0 retries] head_object(:bucket_name=>"xxx-development-bucket-us",:key=>"profiles/profile_images/1/thumb/main_sized_small.png") [aws s3 200 0.053507 0 retries] head_object(:bucket_name=>"xxx-development-bucket-us",:key=>"profiles/profile_images/1/medium/main_sized_small.png") [aws s3 200 0.048024 0 retries] head_object(:bucket_name=>"xxx-development-bucket-us",:key=>"profiles/profile_images/1/large/main_sized_small.png") command :: path=/usr/local/bin/:$path; file -b --mime '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-t5fq8a.png' command :: path=/usr/local/bin/:$path; identify -format '%wx%h,%[exif:orientation]' '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' 2>/dev/null command :: path=/usr/local/bin/:$path; identify -format %m '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' command :: path=/usr/local/bin/:$path; convert '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' -auto-orient -resize "50x" -crop "50x50+0+0" +repage '/tmp/96994f01b3cacc5ddb9ed35b539d8c0420160601-82031-1n0cfvq' command :: path=/usr/local/bin/:$path; identify -format '%wx%h,%[exif:orientation]' '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' 2>/dev/null command :: path=/usr/local/bin/:$path; identify -format %m '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' command :: path=/usr/local/bin/:$path; convert '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' -auto-orient -resize "100x" -crop "100x100+0+0" +repage '/tmp/96994f01b3cacc5ddb9ed35b539d8c0420160601-82031-1fnck50' command :: path=/usr/local/bin/:$path; identify -format '%wx%h,%[exif:orientation]' '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' 2>/dev/null command :: path=/usr/local/bin/:$path; identify -format %m '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' command :: path=/usr/local/bin/:$path; convert '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-1kh6s2w.png[0]' -auto-orient -resize "220x" -crop "220x220+0+0" +repage '/tmp/96994f01b3cacc5ddb9ed35b539d8c0420160601-82031-e3r9iy' command :: path=/usr/local/bin/:$path; file -b --mime '/tmp/3aa49ec6bfc910647fa1c5a013e48eef20160601-82031-ub7nk7.png' (0.4ms) rollback command :: path=/usr/local/bin/:$path; identify -format '%wx%h,%[exif:orientation]' 'https://xxx-development-bucket-us.s3.amazonaws.com/profiles/profile_images/1/original/blake.png?1464811715[0]' 2>/dev/null
my environment:
- paperclip v4.3.6
- papercrop v0.3.0
- aws-sdk v1.66.0
- rails 4.0.0
- ruby 2.0.0p643
- amazon s3 file storage
- os-x yosemite 10.10.5 (same error occurs on heroku linux server)
i have tried following:
- use aws-sdk version 2 or higher.
- uninstall imagemagick installs (i had 2 originally), , reinstall imagemagick brew install imagemagick
- downgrade paperclip 4.1.1
include :s3_credentials , :s3_permissions directly in model, follows:
has_attached_file :profile_image, :styles => { :thumb => "50x50#", :medium => "100x100#", :large => "220x220#" }, :storage => :s3, :s3_credentials => {:bucket => "xxx-development-bucket-us", :access_key_id => "xxx", :secret_access_key => "xxx"}, :s3_permissions => "public-read", :default_url => '/images/:attachment/missing_:style.jpg' validates_attachment :profile_image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png"] } crop_attached_file :profile_image, :aspect => "1:1"
i thought might s3 permissions problem, permissions on our development bucket should allow access user identified keys.
i've added...
paperclip.options[:command_path] = "/usr/local/bin"
...to environments/development.rb.
i've verified imagemagick working on commandline.
any ideas else at?
yes, there many exiting answers different suggestions. tried out every possible solution day , arrived @ solution fixed me.
ubuntu 12.04,paperclip ~> '4.2'
initially having imagemagick 6.6.9-7 2016-06-01 q16, updating imagemagick 7.0.3-1 q16 x86_64 2016-09-27 fixed it.
note: try installing imagemagick manually using wget http://www.imagemagick.org/download/imagemagick.tar.gz