As is always the case with RedHat and CentOS, a number of packages in the usual yum repositories lack heavily behind the advancements made by their authors and teams. One such package is ImageMagick, which as of writing is back at 6.2.8 as opposed to 6.4.8.
This for the most part isn’t an issue unless there is a specific upgrade, bug fix or enhancement you are looking to implement from within the ImageMagick library. In my case it was the use of the caret(^) character for specifying minimum geometric resize values.
Unfortunately none of the yum repositories we regularly use have an updated package for 6.3.x or 6.4.x which left us in a bit of bind. We could either code our way around the issue (expensive, frustrating and time consuming) or seek another upgrade path.
As no stranger to compiling packages from source I grabbed the latest tar.gz from the ImageMagick download page and proceeded to decompress it and compile. I then removed the yum installed package. Unfortunately at the end of this process, whilst the installation had succeeded I received strange error messages from the convert command line utility:
convert: no decode delegate for this image format `Book_icon.png' @ magick/constitute.c/ReadImage/526.
convert: missing an image filename `image.jpg' @ wand/convert.c/ConvertImageCommand/2710.
It turns out this is an easy enough problem to diagnose and resolve. The use of the following command provides an overview of the formats currently supported by our ImageMagick installation.
identify -list format
Well damn, no jpg support, no png, infact lots of things are missing. I guess we are missing some other rather important libraries prior to compilation. After installing the appropriate devel libraries via yum, we can configure again, make clean and install. Phew, thank god it works this time.
yum remove ImageMagick
yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
wget url to ImageMagick download
tar zxvf ImageMagick-6.4.8-3.tar.gz
configure --prefix=/usr/local --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes
make clean
make
make install
Too easy. Unfortunately you won’t get updates to your ImageMagick pushed from yum anymore, so keep the additional administration costs in mind, but for those requiring the latest versions this is the quick way to get setup and running.