Total Pageviews

Friday, 10 May 2013

debian下,通过pecl安装php的ImageMagick扩展:Imagick

sudo apt-get install php-pear
sudo apt-get install imagemagick
sudo apt-get install php5-dev
sudo apt-get install libmagick9-dev
sudo pecl install imagick
此时已经可以看到imagick.so已经生成了,于是乎我就在php.ini中写上extension=imagick.so,重启apache,查看phpinfo中有没有imagick扩展模块。
测试用例:
1
2
3
4
5
$thumb = new Imagick();
$thumb->readImage('test.gif');
$thumb->writeImage('test.jpg');
$thumb->clear();
$thumb->destroy();
php下imagick类具体使用,请参考http://hi.baidu.com/7soon/item/d394c2b55bd3bb70254b09ed
http://cn2.php.net/manual/zh/book.imagick.php
http://www.francodacosta.com/phmagick