Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

NotIdentifiedByImageMagickError with ImageMagick 6.9.4-7 #2223

Closed
mantas opened this issue Jun 5, 2016 · 25 comments
Closed

NotIdentifiedByImageMagickError with ImageMagick 6.9.4-7 #2223

mantas opened this issue Jun 5, 2016 · 25 comments

Comments

@mantas
Copy link

mantas commented Jun 5, 2016

I updated to ImageMagick 6.9.4-7 on OS X. Now I'm getting NotIdentifiedByImageMagickError. The identify command doesn't seem to work with the [0] suffix to the path. It works fine without the [0] suffix. I was able to reproduce it with GIF, JPG and PNG files.

ImageMagick 6.7.7 seems to work both with and without [0] suffix. I didn't test with older versions though.

The [0] bit is added at:

I wonder wether this is a bug on ImageMagick side or they dropped backwards compatibility on this one.

@jasonivers
Copy link

jasonivers commented Jun 6, 2016

There are two more places that use the [0]...
https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb - Line 79 and Line 112.

Removing these makes identify work properly, though I didn't take the time to investigate what else it might break at this time.

Apparently one of the things it does it make it ignore storage: :s3. Goes to show what you get for trying to do a rush job of trying to throw a band-aid on something, rather than trying to understand the actual cause.

@hovsater
Copy link

hovsater commented Jun 7, 2016

Just got bit by this as well after upgrading to the latest version of ImageMagick.

@equivalent
Copy link
Contributor

equivalent commented Jun 7, 2016

👍 confirming bug, colleague of mine done brew update && brew install imagemagick and boom same error.

another colleague has imagemagic 6.9.1-7 on his mac an it works, so it's only imgemagic 6.9.4-7

@psantos10
Copy link

psantos10 commented Jun 7, 2016

Same error here.

I am using imagemagick-6.9.4-7

Command :: file -b --mime '/var/folders/2f/5xv2zdp57v14zt0953ztn8700000gn/T/4902c606364caec64f0d45efae2b8fc120160607-29681-1l1tn0x.png'
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/2f/5xv2zdp57v14zt0953ztn8700000gn/T/4902c606364caec64f0d45efae2b8fc120160607-29681-sikkf0.png[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/2f/5xv2zdp57v14zt0953ztn8700000gn/T/4902c606364caec64f0d45efae2b8fc120160607-29681-sikkf0.png[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>

@hovsater
Copy link

hovsater commented Jun 7, 2016

If you've installed Imagemagick via Homebrew and temporarily need to revert back to the previous version you can do this doing the following.

$ brew uninstall imagemagick
$ cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core
$ git checkout fbc910fd5e9982ce6f39460a05c5975c863903e2 Formula/imagemagick.rb
$ brew install imagemagick
$ git reset --hard HEAD
$ brew update
$ brew upgrade
$ brew switch imagemagick 6.9.4-6

When this issue resolves you can simply switch back to the latest version and run brew cleanup to get rid of the old version.

@michelboaventura
Copy link

It seems a bug with imagemagick itself. I has been fixed on master: ImageMagick/ImageMagick#214

@chrisjeon
Copy link

@KevinSjoberg that worked. Thanks!

@blakeage
Copy link

blakeage commented Jun 7, 2016

@KevinSjoberg When I get to the line:

git checkout fbc910fd5e9982ce6f39460a05c5975c863903e2 Formula/imagemagick.rb

I get the following error:
fatal: reference is not a tree: fbc910fd5e9982ce6f39460a05c5975c863903e2

Any ideas?

@lifeiscontent
Copy link

@blakeage try brew update first

@blakeage
Copy link

blakeage commented Jun 7, 2016

@lifeiscontent I tried that, but no luck. I wonder if this is because I tried installing ImageMagick via the --HEAD option

@hovsater
Copy link

hovsater commented Jun 7, 2016

@blakeage what is the output of brew tap? Also make sure you're in the correct directory, homebrew-core.

@blakeage
Copy link

blakeage commented Jun 7, 2016

@KevinSjoberg
Blakes-MacBook-Pro:homebrew-core blakemiller$ brew tap
homebrew/boneyard
homebrew/core
homebrew/versions

Blakes-MacBook-Pro:homebrew-core blakemiller$ pwd
/usr/local/Library/Taps/homebrew/homebrew-core

@hovsater
Copy link

hovsater commented Jun 7, 2016

@blakeage Looks okay to me. You can probably untap homebrew/boneyard but that should not interfere with checking out the proper commit. What does git status give you? What does git log HEAD~5 --grep imagemagick give you?

@blakeage
Copy link

blakeage commented Jun 7, 2016

@KevinSjoberg I untapped boneyard.

git status returns:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

git log HEAD~5 --grep imagemagick returns/prints nothing.

@hovsater
Copy link

hovsater commented Jun 7, 2016

@blakeage does git log give you any output? What is the output of git remote -v?

@blakeage
Copy link

blakeage commented Jun 7, 2016

@KevinSjoberg Yea, git log returns a bunch of commits from today.

git remote -v
origin https://github.com/Homebrew/homebrew-core (fetch)
origin https://github.com/Homebrew/homebrew-core (push)

I'm guessing reinstalling Homebrew may be the way to go?

@hovsater
Copy link

hovsater commented Jun 7, 2016

@blakeage this is beyond me. I'd try git reset --hard origin/master and/or brew update. Maybe run brew doctor to ensure everything is fine.

@blakeage
Copy link

blakeage commented Jun 7, 2016

@KevinSjoberg Thanks for the help anyway Kevin. I'll report back if I figure it out.

@lsamayoa
Copy link

lsamayoa commented Jun 8, 2016

@blakeage I had the same problem, and it was because homebrew only pulls some commits from the taps (specifically it does a shallow pull). What I´ve done to get arround this is to clone the whole homebrew-tap and replaced my homebrew-tap with the full repository of the tap.

brew uninstall imagemagick
mv $(brew --prefix)/Library/Taps/homebrew/homebrew-core $(brew --prefix)/Library/Taps/homebrew/homebrew-core.old
git clone https://github.com/Homebrew/homebrew-core $(brew --prefix)/Library/Taps/homebrew/homebrew-core
cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core
git checkout fbc910fd5e9982ce6f39460a05c5975c863903e2 Formula/imagemagick.rb
brew install imagemagick
git reset --hard

@mherold
Copy link

mherold commented Jun 8, 2016

ImageMagick 6.9.4-8 is now available via homebrew, fixed it for me.

@mantas
Copy link
Author

mantas commented Jun 8, 2016

Can confirm that ImageMagick 6.9.4-8 fixes it. Closing this issue.

@YarikST
Copy link

YarikST commented Jun 4, 2018

Installing libmagickwand-dev seemed to sort it out.

  1. sudo apt autoremove imagemagick
  2. rm /usr/bin/convert and rm /usr/bin/convert-im6
  3. sudo apt-get install imagemagick
  4. sudo apt-get install libmagickwand-dev

sudo apt install ffmpeg


ImageMagick delegates video processing. I lost more than 5 hours to understand why such a bug NotIdentifiedByImageMagickError


install make https://www.imagemagick.org/discourse-server/viewtopic.php?t=24284

@phansch
Copy link

phansch commented Oct 11, 2018

If you hit this error since October 2018 on Ubuntu, here is the relevant Imagemagick changelog: https://launchpad.net/ubuntu/+source/imagemagick/8:6.7.7.10-6ubuntu3.13

* SECURITY UPDATE: code execution vulnerabilities in ghostscript as
  invoked by imagemagick
  - debian/patches/200-disable-ghostscript-formats.patch: disable
    ghostscript handled types by default in policy.xml

To make PDF uploads work again, you have to update /etc/ImageMagick-6/policy.xml.

Change

<policy domain="coder" rights="none" pattern="PDF" />

to

<policy domain="coder" rights="read|write" pattern="PDF" />

Relevant stack overflow: https://stackoverflow.com/a/52661288

@pierre-alain-b
Copy link

I hit this problem in Debian Stretch starting around early Dec 2018. I fixed it temporarily by reverting to an older version of ghostscript.
apt-get install libgs9=9.20~dfsg-3.2+deb9u5 ghostscript=9.20~dfsg-3.2+deb9u5 libgs9-common=9.20~dfsg-3.2+deb9u5

My explanation, not yet confirmed, is that the recent update to Ghostscript 9.26 in Debian Stretch Security caused the issue to pop up. Further investigation to do...

@pierre-alain-b
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests