65

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?

j0k
  • 21,914
  • 28
  • 75
  • 84
Trolley
  • 2,178
  • 2
  • 21
  • 28
  • 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 06 '12 at 14:56
  • Could you clarify what OS you're using, and which version of ImageMagick? – florisla Jan 26 '17 at 09:40

10 Answers10

74

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.

Jonathon Horsman
  • 2,243
  • 1
  • 20
  • 18
  • 2
    In my case was missing libpng - installed it with MacPorts, this triggered a rebuild of ImageMagick. . – Jasper Blues Feb 11 '13 at 09:37
  • Never could get Imagemagick to find TIF files so I used [GraphicsMagick](http://www.graphicsmagick.org/) instead. That worked. – Sukima Nov 06 '13 at 22:02
  • 1
    Same situation. Reinstalling imagemagick was not enough--had to specify jpeg. – Rob Sobers Mar 15 '14 at 04:00
  • 2
    awesome answer, Love the "identify -list format" so i can actually see whats missing. thanks! – Will May 17 '14 at 05:27
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.

deepwinter
  • 4,108
  • 2
  • 29
  • 35
  • installing this way was critical for me to get TIFF files working properly. A regular imagemagick install was not working. – nfriend21 Mar 01 '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 09 '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
15

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

-resize 600X600
Dorian
  • 19,009
  • 8
  • 108
  • 111
tgfuellner
  • 176
  • 1
  • 3
  • 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 04 '15 at 17:13
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 :)

R Sun
  • 871
  • 10
  • 13
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

Community
  • 1
  • 1
wawa
  • 556
  • 4
  • 12
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)

mathieuc
  • 31
  • 2
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 ;).

Gerard ONeill
  • 3,193
  • 31
  • 22
  • 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 '21 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 '21 at 20:53
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.

shaneparsons
  • 1,133
  • 1
  • 14
  • 23
  • 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 04 '20 at 13:33
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.
florisla
  • 8,866
  • 4
  • 31
  • 41
0

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

file_get_contents($pathToPhoto)

maybe someone help :[

Kamil Dąbrowski
  • 949
  • 8
  • 12