Posted: July 13th, 2010

Installing ImageMagick, and pecl imagick

Category: technical
Tags:

I needed ImageMagick to do some image manipulation, i ran across this very cool php extension. instead of using GD. you may run into some small snafus while trying to install it. my system is fedora core 12

first thing you do is install ImageMagick, and ImageMagick-devel

yum install ImageMagick-devel ImageMagick

then you run pecl

pecl install imagck

if you run into any problems like re2c not being up to date. pull the latest RPM, and install.

the cool thing about this extension is when you want to resize images on the fly its as easy as this

<?php

header(‘Content-type: image/jpeg’);

$image = new Imagick(‘image.jpg’);

// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);

echo $image;

?>