Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image file is not recognized by the 'identify' command. (heroku)

I'm trying to have Paperclip working with Heroku and Amazon S3.

Everything works fine on localhost (mac OS and Amazon), but when I'm deploying to heroku and trying the feature, I have this error :

2 errors prohibited this area from being saved:
Asset /tmp/paris20121005-2-2cwxgx.jpg is not recognized by the 'identify' command.
Asset /tmp/paris20121005-2-2cwxgx.jpg is not recognized by the 'identify' command.

It works when I remove the :styles => { } option in my model, but the file isn't processed (I need different image sizes).

I also have the rmagick gem in my gemfile.

Here is my gemfile (only the paperclip part) :

gem "paperclip"
gem "rmagick", :require => 'RMagick'
gem 'aws-sdk', '~> 1.3.4'

I don't have Paperclip.options[:command_path] set in my environment.rb or production.rb so no problem on this side.

Here is my model :

class Area < ActiveRecord::Base
  require 'RMagick'
  has_attached_file :asset, :styles => { :medium => "300x300>", :thumb => "180x190>" },
       :storage => :s3,
       :s3_credentials => "#{::Rails.root.to_s}/config/s3.yml",
       :url => :s3_domain_url.to_s,
       :path => "/:style/:id/:filename"
end

Any clue on that ? I've crawled every topics about it and nothing seems to work...

Thanks

like image 933
Loïc Reperant Avatar asked Oct 05 '12 16:10

Loïc Reperant


1 Answers

Apparently the new update to Cocaine gem (0.4.0) breaks the file names for Paperclip and ImageMagick. try rolling back to the previous version (0.3.2), it worked for me.

See here:

https://github.com/thoughtbot/paperclip/issues/1038

PS I believe RMagick is no longer needed on Heroku, works fine for me without it

like image 110
Itai Leibowitz Avatar answered Nov 07 '22 12:11

Itai Leibowitz