Installation of Image::Magick under Debian

Table of contents

Installation of Image::Magick under Debian
Introduction
Installation
Debian and Fonts
Sample code
Author

Installation of Image::Magick under Debian

Introduction

Image::Magick can be very difficult to install, so this article shows how to compile from source.

If you can use Debian's packaging system, that's often the easiest way, but of course limits you to whatever version is available from Debian's repo. The steps are:

        shell> aptitude install ImageMagick
        shell> cpanm Image::Magick

I did not use that method myself, but I do suggest you try it before the instructions herein.

Also, there is Alien::ImageMagick. However, using that module still requires ImageMagick to be compiled, and may well require Perl itself to be re-compiled, so be sure to scrutinize the instructions before attempting it.

Installation

o Preparation

shell> sudo aptitude install libpng12-dev libgraphviz-dev libjpeg8-dev libfreetype6-dev

o Download

http://git.imagemagick.org/repos/ImageMagick

o Click on Files (on the left)
o Change the branch to ImageMagick-6
o Don't click on 'Download Zip' but do click on the down-arrowhead beside it
o Click on Download tar.bz2
o In your shell, go to ~/Downloads
o Observe ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de.tar.bz2

mv ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de.tar.bz2 ImageMagick

cd ImageMagick

bunzip2 ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de.tar.bz2

tar xvf ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de.tar

cd ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de

o Remove '-lperl' from these 3 files...

vi PerlMagick/Makefile.PL.in PerlMagick/default/Makefile.PL.in PerlMagick/quantum/Makefile.PL.in

o Double check...

ack lperl

o Install

See http://imagemagick.org/script/advanced-unix-installation.php

./configure --with-gnu-ld --with-perl

make

sudo make install

dir /usr/local/lib

o Observe /usr/local/lib/ImageMagick-6.9.3/
o Test

convert -version

Output:

        Version: ImageMagick 6.9.3-0 Q16 x86_64 2015-12-27 http://www.imagemagick.org
        Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
        License: http://www.imagemagick.org/script/license.php
        Features: Cipher DPC OpenMP
        Delegates (built-in): fontconfig freetype gvc jng jpeg pangocairo png x xml zlib

convert logo: logo.gif

identify logo.gif

Output:

logo.gif GIF 640x480 640x480+0+0 8-bit sRGB 256c 28.6KB 0.000u 0:00.000

o Test Image::Magic

perl -e 'use Image::Magick; print Image::Magick->QuantumDepth,"\n"'

Output:

16

o Clean up

cd ..

rm ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de/

ImageMagick-ImageMagick-6-9043f3d1fb76c8f4f158d75dc6e2455c43d2f1de.tar

o To use Image::Magick

http://imagemagick.org/script/perl-magick.php

Debian and Fonts

If you're using Debian, run fc-list for a list of installed fonts.

More information on Debian's support for fonts can be found on Debian's wiki.

Sample code

http://savage.net.au/ImageMagick/Debian.font.list.p.l.txt

Author

Ron Savage. 2015-12-30.