Installing Imagemagick from source in Debian


Logo for ImageMagick

Image via Wikipedia

I have always had a good experience with Imagemagick in my career. Read this post – you will know HOW.

I can understand since it was CentOS, but with Debian I thought it might come handy if you choose to install Imagemagick from source. NAH! – never think like that. For one of our project, my colleague requested me to upgrade this package I thought it will be good and easy, just shoot the command “apt-get install imagemagick” phew – I got no updates.

Debian Lenny has a latest stable release of Imagemagick 6.6.0 and the current version is 6.6.9, AAH!.

Like I said I’ve always had a good experience with Imagemagick, thought it would be a good experience installing a package by source especially Imagemagick :-).

Install (below) delegates before installing ImageMagick.

As-usual, I went to Imagemagick website and found 6.6.7 from their archive.

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.7-10.tar.gz
tar -zxf ImageMagick-6.6.7-10.tar.gz
cd ImageMagick-6.6.7-10.tar.gz
./configure LDFLAGS=’-L/usr/local/lib -R/usr/local/lib’ –with-xml
### configuring imagemagick with xml will enable you to convert
### an image from a remote server to local.
### for ex: convert http://example.com/sample.jpg test.jpg
make
make install

Simple, isn’t – everything went well until I tested the commands.

Problems:

I ran a simple command:

convert sample.jpg test.jpg
convert: no decode delegate for this image format sample.jpg

I was literally LAUGHING – because I love challenges.

Before searching or trying to solve the problem, I wanted to understand root-cause of the error and what is meaning of the word “delegate” in the error. I queried in Google for “imagemagick delegates” – got some bunch of results. The very first results is the index of all the available delegates in imagemagick. Imagemagick delegates are the libraries used by Imagemagick to convert images from one form to the other. In other words, It relies on a number of delegate programs to support certain image formats.

There were quite a few delegates: jpeg, tiff, png, xml, zlib, ghostscript, freetype, etc.

Solution:

This becomes a mandatory for Imagemagick to work with conversion, choose those delegates that you may want for your job. We wanted “jpeg, tiff, png, xml, zlib, ghostscript, freetype” delegates and you have to install delegates FIRST then Imagemagick. Yes, I had to uninstall imagemagick again to get these delegates useful for imagemagick.

REMEMBER: You have to install delegates first and then Imagemagick

You can find ImageMagick delegates from: http://www.imagemagick.org/download/delegates/

Example:
wget http://www.imagemagick.org/download/delegates/jpegsrc.v8.tar.gz
./configure
make
make install

Repeat the above steps for any other delegate that you wish to install.

Happy Installing!.

About these ads
Leave a comment

4 Comments

  1. REMEMBER: You have to install delegates first and then Imagemagick.

    I will remember from now on words.

    Thanks Rakesh. :)

    Reply
  2. :-) – Welcome Noor Bhai.

    Reply
  3. Arafin Rubab

     /  January 23, 2012

    Thank you for your wonderful articles especially the importance of information provided in this article.

    Reply
  1. Installing ImageMagick in Linux (Cent)OS with YUM « SHAREsome & learnMORE – Rakesh Sankar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 104 other followers

%d bloggers like this: