Summary
ImageMagick is a powerful image processing toolkit, and many Internet applications involve image processing, such as cutting, zooming, watermarking, and format conversion. The ImageMagick is an ideal toolkit.
Installation base Dependencies
Check that some basic image support packages are already installed, such as JPGE and PNG.
Under Redhat Environment:
Rpm-qa | grep libpng-devel
Rpm-qa | grep libjpeg-devel
If not, you can use Yum or download the source to install:
Yum-y Install Libpng-devel Libjpeg-devel
To install the WEBP library:
Download libwebp-0.3.0.tar.gz First
wget http://blog.xinfilm.com/softdir/libwebp-0.3.0-linux-x86-64.tar.gz
TAR-ZXVF libwebp-0.3.0.tar.gz
CD libwebp-0.3.0
./configure && make && make install
cp/usr/local/lib/libwebp.so.4.0.2/usr/lib64/
Ln-s/usr/lib64/libwebp.so.4.0.2/usr/lib64/libwebp.so.4
Ln-s/usr/lib64/libwebp.so.4.0.2/usr/lib64/libwebp.so
Install ImageMagick:
wget http://blog.xinfilm.com/softdir/ImageMagick-6.8.4-8.tar.gz
TAR-ZXVF imagemagick-6.8.4-8.tar.gz
CD imagemagick-6.8.4-8
./configure--prefix=/usr/local/imagemagick--WITH-WEBP
Make && make install
Ln-s/usr/local/imagemagick/include/imagemagick-6/usr/local/imagemagick/include/imagemagick
To configure environment variables:
Export Magick_home=/usr/local/imagemagick
Check whether the installation was successful:
Convert-list format View supported formats (PNG,JPEG,WEBP)
Install PHP5.4.9, source installation: (To install mysql-client first)
Refer to this article: http://blog.xinfilm.com/?p=193
TAR-ZXVF php-5.4.9.tar.gz
CD php-5.4.9
./configure--prefix=/usr/local/php--with-mysql=/opt/apps/mysql-client/--enable-fpm--with-fpm-user=nobody-- With-fpm-group=nobody
Make && make install
CP Php.ini-production/usr/local/php/php.ini
To install the imagick-3.1 module:
Download wget http://blog.xinfilm.com/softdir/imagick-3.1.0RC2.tgz
TAR-ZXVF imagick-3.1.0rc2.tgz
CD IMAGICK-3.1.0RC2
/usr/local/php/bin/phpize
Export Pkg_config_path=/usr/local/imagemagick/lib/pkgconfig
./configure--with-php-config=/usr/local/php/bin/php-config--with-imagick=/usr/local
/imagemagick
Make && make install
The installation is complete and the image can be easily processed in the code.
This article transferred from: http://my.oschina.net/u/142836/blog/169382