PaperClip Error NotIdentifiedByImageMagickError when scaling images

亡梦爱人 提交于 2019-12-03 23:46:30

I just solved this issue. brew makes a directory call Cellar, /usr/local/Cellar Verify if you don`t have two ImageMagick, i had one named ImageMagick-Ruby182, so, if you have it run brew uninstall ImageMagick-Ruby182, and also the normal imagemagick, and reinstall image magic.

We just ran into this issue, and it turned out to be an issue where ghostscript wasn't installed. I took the advise of Scott Cornwell and removed the silencing of errors, and then determined that convert was failing because ghostscript wasn't available.

   brew install ghostscript 

Fixed the issue for us.

I had the same issue, although my server is on Linux. Can't tell you exactly how to do it because I don't have a Mac to test, but hopefully this points you in the right direction.

This worked for me with ImageMagick 6.8.5-5, Paperclip 3.4.2, latest version of cocaine, Rails 3.2.13:

I went into geometry_detector_factory.rb in the Paperclip gem and commented out the 2 lines around the identify call: (this step is not necessary, just explaining what I did to determine the problem)

#silence_stream(STDERR) do 
    Paperclip.run("identify", "-format '%wx%h,%[exif:orientation]' :file", :file => "#{path}[0]")
#end

along with the corresponding "end" statement. This allowed me to see the errors on the command line when running the "identify" command.

Basically the error said: "no decode delegate for this image format"

You can probably look up that error and get it figured out, but basically what I did was go to usr/local/bin and run: (also not necessary, unless you want to see what you have installed)

convert -list configure

and look for the DELEGATES line. I had another Linux server where ImageMagick was working and after comparing the two I realized the new one had only 2 delegates installed. I was able to run:

yum install ImageMagick-devel

and then recompile ImageMagick with make, make install and it worked.

You can also find the delegates manually on the ImageMagick site and install them one by one but that library pretty much covered it for me.

Debugging ImageMagick? Ain't nobody got time for that!

Had the problem on my window dev environment, using paperclip 3.5.2, cocaine 0.5.3, and ImageMagic 6.8.8.

Solution was to add:

Paperclip.options[:command_path] = 'C:\Program Files\ImageMagick-6.8.8-Q16'

to config/environment/development.rb

I had similar issue, but older PaperClip (3.0.2).

In my case I fixed it with:

gem 'cocaine', '0.3.2'

Reinstalling libtool brew install libtool worked for me.

Please update the version of paperclip gem and cocaine gem. Set PaperClip version: 3.4.1 Set Cocaine version: 0.5.

I faced the same problem and my issue was already there in paperclip gem github issues

You already mentioned that you tried upgrading ImageMagick, but I had the same issue and upgrading to ImageMagick 6.8.0-10 2013-03-03 fixed it for me.

Had same issue with image_magic that was breaking our paperclip functionality in production, but not in development (weird, I know). Yet even after removing imagemagick from our gemfile and Gemfile.lock locally (running bundle install and all that stuff) and then deploying back to production on heroku, the error persisted in production! (weird, I know).

What ended up doing the trick was running:

$ heroku repo:purge_cache -a myAppName

(Taken from: https://github.com/heroku/heroku-repo#purge_cache)

When you deploy your app, Heroku caches some things like your assets and installed gems in order to speed up deployment. Although this is a great feature, it can have side-effects sometimes, and in this case, it seems that something about the imagemagick gem got "stuck" in production's cache, which is why purging solved the issue for us (since after purging, your app will rebuild itself from scratch on your next deployment)

I have the same issue, and I solved it, when i configure the dynamic linker run-time bindings to create the necessary links and cache to the most recent shared libraries using the ldconfig command.

So you need to use the following command:

sudo ldconfig /usr/local/lib

Actually, I advice to re-install imagemagick using steps at how-to-install-image-magick-and-setup-paperclip.

Just for the record:

brew uninstall libtool
brew install libtool
brew uninstall jpeg
brew install jpeg
brew link --overwrite jpeg
brew unlink freetype && brew link freetype
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!