[koderz.org]

PHP + ImageMagick = imagick

Don't know if anyone already knows it, but there's a PHP module for Imagemagick, sort of like the one for GD. It's called imagick.

 

Documentation about Installation and using the functions can be found at php.chregu.tv/imagick

 

I've compiled and used it, and think it's cool! Here's an example:


<?
if(!extension_loaded('imagick')) { dl('imagick.so'); }
$handle = imagick_create();
imagick_set_attribute($handle,array("quality"=>1,"magick"=>"png"));
imagick_set_attribute($handle,"size","98x20");
imagick_read($handle,"xc:#cccccc");
imagick_annotate($handle,array(
    "primitive"     =>  "text 10,14 hello",
    "pointsize"     =>  16,
    "antialias"     =>  1,
    "stroke"        =>  "#000000",            
    "font"          =>  "arial.ttf",
));
$handle = imagick_copy_rotate ($handle, 270);
header("Content-type: image/png");
imagick_dump($handle,"png");
?>

How to compile it!

All you have to do is follow the docs from the source! Get it here : pear.php.net/get/imagick

More info canbe found at pear.php.net/package-info.php

 

Hahaha, that's the one thing you dont want to do, because you are, just like me, plain lazy!

 

So, if you trust me enough, and you've got PHP 4.2.2 on a Glibc 2.2.4+ system (RH 7.3+ / Apache 1.3.x) you can also download the compiled .so file

 

NB: the module does NOT work on Apache 2.0. I'm still working on that.


Download imagick.so

imagick.so   112 K

Yes, downloaded it. And now?

Put the file in your module directory (ie: /usr/lib/php4) and make int executable (chmod +x /usr/lib/php4/imagick.so)

 

Then, modify your php.ini (if you want to have the module loaded at all times). Add the line:

 

extension=imagick.so

 

Restart your webserver. Done! Use the code provided.



Setup Pilot/Evolution sync on RH 8.0
getfreedb - Audio CD listings generator
rpminst - Remote .rpm file installer
PHP + Namazu
PHP5 + Namazu
PHP + ImageMagick
 --  Comments to leening-at-koderz.org