67

I'm trying to convert an image with imagemagick, but I'm getting this error:

convert: no decode delegate for this image format `//i.imgur.com/nTheJ.jpg' @ error/constitute.c/ReadImage/532.

I'm doing this:

convert http://i.imgur.com/nTheJ.jpg -resize 600×600 filarkiv/billeder/produkter/s236-085145.jpg

I have the following delegates:

DELEGATES freetype jpeg jng mpeg png x11 xml zlib

Anyone knows what the problem is?

2
  • Well, you have the JPEG delegate and it says there is a problem. Which poses the question, what is the matter with the source file? Or, the JPEG installation. – Orbling Mar 6 '12 at 14:56
  • Could you clarify what OS you're using, and which version of ImageMagick? – florisla Jan 26 '17 at 9:40

10 Answers 10

15

substitude the × in -resize 600×600 with a capital X and it should work.

-resize 600X600
2
  • 1
    Didn't work for me: ERROR ArgumentError: Didn't recognise the geometry string 100X100 – Jonathon Horsman Apr 25 '12 at 15:38
  • that is so bizarre. it was working fine with the lowercase "x" until I started converting blob type files. I did what you said and everything worked again. – wle8300 Nov 4 '15 at 17:13
75

I had this error when rendering an image using DragonFly in Rails. This happened after I upgraded to Lion (ImageMagick was installed using Brew).

I reinstalled ImageMagick, jpeg, libtiff and jasper (reinstalling ImageMagick wasn't enough by itself).

brew uninstall imagemagick jpeg libtiff jasper
brew install imagemagick

Prior to that, running

identify -list format

and jpeg wasn't in the list. After reinstalling the above packages jpeg appeared in the list.

4
26

for me:

 brew reinstall imagemagick --with-libtiff

saved the day when dealing with a similar problem, but for tiff files.

UPDATE: one year later and this remains the only way I can get tiff working properly in convert on MacOS X.

3
  • installing this way was critical for me to get TIFF files working properly. A regular imagemagick install was not working. – nfriend21 Mar 1 '15 at 13:25
  • You can use brew info imagemagick to see what other options you can reinstall imagemagick with using brew. Very useful. – Jeremy S. Feb 9 '17 at 16:02
  • 2
    Warning: imagemagick: this formula has no --with-libtiff option so it will be ignored! – Dorian Apr 29 '18 at 14:55
3

I faced the same problem recently. After Googling for couple of hours, I found out that reason was a CONFLICT between php extentions Gmagick & Imagick. Commenting gmagick.so in php.ini fixed the problem. Hope this will save someone time :)

3

redhat4.8, If you install from source, may be can try:

yum remove libjpeg

wget http://www.imagemagick.org/download/delegates/jpegsrc.v9a.tar.gz

sudo tar xvf jpegsrc.v9a.tar.gz -C /usr/local/src/

cd /usr/local/src/jpeg-9a

./configure --enable-shared

make

sudo make install

than turn in ImageMagick

cd ImageMagick-6.9.6-4

./configure

sudo make install

sudo ldconfig /usr/local/lib

0
3

on Ubuntu 16, I had to install the following first (this was not a dev machine but a server):

sudo apt-get install autoconf automake autotools-dev libtool pkg-config 

then to enable the PNG and JPG delegates :

sudo apt-get install libpng12 libpng12-dev libjpeg libjpeg-dev

followed by

./configure

(Which should now show that the delegates are enabled)

and then rebuild (make clean && make then sudo make install)

2

In my case, the solution was a matter of ending the command with *.{jpg,png} rather than *.

I believe the * was picking up / trying to convert hidden files.

1
  • 1
    YOU are the man - my mogrify script was failing because it had "no decode delegate for this image format DB. After a bit I realised it was trying to convert directories because I had left * at the end of the command rather than specifying the file name. – 5Diraptor Aug 4 '20 at 13:33
2

from Phillip Ingram somewhere on the interwebs:

in gentoo use

sudo EXTRA_ECONF="--with-png --with-jpeg" emerge imagemagick

This is slightly different than Jonathan Horseman's answer since it wasn't an error but rather a need to specify more during the installation.

But the identify command was very useful.

Hope this helps someone (and perhaps me in the future ;).

3
  • This doesn't seem to be valid syntax (unbalanced quotes, at the least), so it's not clear what was intended here, but it would be helpful. – TTT Aug 13 '18 at 22:25
  • @TTT Just remove the quote at the end – Shidouuu Apr 13 at 15:33
  • Hopefully that was a cut and paste error with an extra quote, rather than a cut and paste error with something missing ;). Fixed. – Gerard ONeill Apr 13 at 20:53
0

I have encountered a similar problem with TIFF files on ImageMagick v7.0.4-5 on Windows 7.

If this question concerns a Windows OS, then the cause is that Windows can't find the Jpeg (in my case, TIFF) file library (DLL).

Cause

I had installed ImageMagick without adding it to the Windows $PATH.

Error message

This resulted in error

identify: unable to load module 'C:\Program Files\ImageMagick-7.0.4-Q16\modules\coders\IM_MOD_RL_TIFF_.dll':
The specified module could not be found.
 @ error/module.c/OpenModule/1279.
identify: no decode delegate for this image format `TIFF'
 @ error/constitute.c/ReadImage/509.

Solution

  • Re-install ImageMagick and do add it to the $PATH, so that it can find libtiff. Restart your command shell as well.
  • First cd into ImageMagick's install folder before executing it.
0

i had the problem and i forgot put to obj downloaded photo against i put path.

file_get_contents($pathToPhoto)

maybe someone help :[

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.