让阿里云的Centos,PHP组件 ImageMagick支持png和jpeg格式

我们在Centos安装ImageMagick教程中讲述了如何安装ImageMagick,安装完毕之后发现程序并不支持png和jpeg格式的图片,但是这两种图片又是我们平时所常见的,所以我们还要进一步地配置,是其支持png和jpeg格式.

首先我们安装所需的库文件.

1

$ yuminstalltcl-devel libpng-devel libjpeg-devel ghostscript-develbzip2-devel freetype-devel libtiff-devel

进入ImageMagick的下载解压后的目录,重新配置,并编译安装.

$ ./configure--with-bzlib=yes--with-fontconfig=yes--with-freetype=yes--with-gslib=yes--with-gvc=yes--with-jpeg=yes--with-jp2=yes--with-png=yes--with-tiff=yes

$makeclean

$make

$makeinstall

顺利安装完毕之后,我们再用phpinfo查看,发现已经支持png和jpeg格式的文件了.

http://www.yuweixian.com/linux/centos6-3-install-imagemagick.html

http://www.yuweixian.com/linux/centos6-install-imagick.html