Tuesday, November 27, 2007

Installing ImageMagick with JPEG and PNG Support

ImageMagick is a set of command-line tools for manipulating image files. By default it supports GIF but not the other command interweb formats of JPG (JPEG) and PNG. These are the steps I followed to install ImageMagick on an Amazon EC2 Fedora core-4 Linux image.

This process is also described at Installing ImageMagick with JPEG, TIFF and PNG Support, but I had some problems with a couple of the commands there, it was using files older than the current, and it included TIFF support which I don't expect to be using.

The first step was to get the required source files for each of the components required. These are the files I retrieved, and the web addresses were I retrieved them. (Note, the exact version numbers change over time.) Each of the .tar.gz files I downloaded and copied to the /usr/local/src directory of my EC2 linux system.
from my linux image I then performed these commands (and in this order) to unpack, compile, and install the components and ImageMagick.
  1. cd /usr/local/src
  2. gunzip -c zlib-1.2.3.tar.gz | tar xvf -
  3. rm zlib-1.2.3.tar.gz
  4. cd zlib-1.2.3
  5. ./configure
  6. make
  7. make install
  8. cd /usr/local/src
  9. gunzip -c libpng-1.2.23.tar.gz | tar xvf -
  10. rm libpng-1.2.23.tar.gz
  11. cd libpng-1.2.23
  12. ./configure
  13. make
  14. make install
  15. cd /usr/local/src
  16. gunzip -c jpegsrc.v6b.tar.gz | tar xvf -
  17. rm jpegsrc.v6b.tar.gz
  18. cd jpeg-6b
  19. ./configure --enable-shared
  20. make
  21. make install
    [may need to create man directories]
  22. cd /usr/local/src
  23. gunzip -c ImageMagick.tar.gz | tar xvf -
  24. rm ImageMagick.tar.gz
  25. cd ImageMagick-6.3.7
  26. ./configure
    [verify that jpeg and png are on]
  27. make
  28. make install
Now run a simple test to see that ImageMagick is working
  1. cd /
  2. identify –list Format
    [verify that jpeg and png are on]
  3. convert logo: logo.gif
  4. convert logo: logo.jpg
  5. convert logo: logo.png
    [verify with separate viewer that this images are all OK]
That's it. The ImageMagick command are now ready.

No comments:

Post a Comment