I have installed the ImageMagick extension for PHP on CentOS, but it does not have support for PNG or JPG, how do I add support for these file types to ImageMagick?
5 Answers
You would possible need to compile it from the source with the options to what you have misssing:
- yum remove ImageMagick
- yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
- wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.3-5.tar.gz
- tar zxvf ImageMagick-6.6.3-5.tar.gz
- cd ImageMagick-6.6.3-5
- ./configure --prefix=/usr/local --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
- make clean
- make
- make install
-
-
after you have done this what was the output of
identify -list format
did any error occur during the proccess ?– PrixAug 20, 2010 at 3:15
Always you face a problem related to the system thing, give details about your enviroment: version of packages, version of linux distribution, etc. That said, it is known that ImageMagick 6.4.x on CentOS 5 give problems with formats you explained.
You get a bunch of details on this post of Andrew Duck:
He got solution removing ImageMagick package, and compiling the source plus related stuff:
yum remove ImageMagick
yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
wget url to ImageMagick download
tar zxvf ImageMagick-6.4.8-3.tar.gz
configure --prefix=/usr/local --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
make clean
make
make install
Which ImageMagick extension for PHP on CentOS did you install, and how did you do it? As far as I'm aware, there isn't such an extension in base CentOS 5.x. Did you use the php-pecl-imagick
package from EPEL? That should already be built with PNG and JPEG support.
ehm, just in case, do you have an x86_64 CentOS system ? you install the *-devel for x86_64 ? i386 ? do you ref to the correct header/libs in the build for x86_64 if you have and x86_64 system ?
identify -list format