ImageMagick missing decode delegates

14,301

Here's a quick and dirty on installing the latest (version 6.8.4-6 as of this writing) ImageMagick on Ubuntu 12.04.

Start by removing any old versions previously installed via apt-get:

sudo apt-get remove imagemagick

Then update apt-get and install some supporting packages:

sudo apt-get update
sudo apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config

Use wget to grab the source from ImageMagick.org.

Once the source is downloaded, uncompress it:

tar -xzf ImageMagick.tar.gz

Now configure and make:

cd ImageMagick-6.8.4-6
./configure
sudo make
sudo make install

To avoid an error such as:

convert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory

Add the following line to ~/.bashrc:

export LD_LIBRARY_PATH=/usr/local/lib

Update: If you still get an error like the one above, try running ldconfig:

sudo ldconfig

You can confirm the install and available formats with:

identify -list format
Share:
14,301
pepe
Author by

pepe

Updated on June 04, 2022

Comments

  • pepe
    pepe almost 2 years

    I recently moved to MediaTemple and installed ImageMagick and IMagick following their KB article here.

    No error and phpinfo() show module correctly installed.

    When I try to use IM on a JPG image via PHP I get this error

    Uncaught exception 'ImagickException' with message 'no decode delegate for this image format 
    /home/149263/domains/wer.com/html/images/pictures/post/tmp/original/' @ error/constitute.c/ReadImage/544' in /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php:301
    Stack trace:
    #0 /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php(301): Imagick->__construct('/home/149263/do...')
    #1 [internal function]: Post->filter('punch')
    #2 /nfs/c10/h04/mnt/149263/domains/wer.com/html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array)
    #3 /nfs/c10/h04/mnt/149263/domains/wer.com/html/index.php(217): require_once('/nfs/c10/h04/mn...')
    #4 {main} thrown in /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php on line 301
    

    However convert -list configure returns

    DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jp2 lcms openexr png rsvg tiff wmf x11 xml zlib
    

    and identify -list format returns

    JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (62)
    JPG* JPEG      rw-   Joint Photographic Experts Group JFIF format
    

    So it looks like the installation is correct.

    ImageMagick 6.7.7-0 2012-05-22 
    imagick module version  3.1.0RC1
    

    Any suggestions how to troubleshoot this?

  • pepe
    pepe almost 12 years
    argh, bonzo thx for replying - it was my bad, the filename was not being passed correctly to IM and therefore it was crashing - the hint was 2nd line of error log above showing no filename
  • Bonzo
    Bonzo almost 12 years
    Glad its sorted; although IM's error reporting can be confusing sometimes.