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?
-
2What is the output of `identify -list format` – Prix Aug 14 '10 at 00:02
-
I don't understand why it wouldn't have support for those unless it was compiled that way for a specific purpose. Are you sure you have the right package? – Dennis Williamson Aug 14 '10 at 00:49
-
Dennis in some cases (i.e.: using yum) it may not install a program with all it is features, resulting in the need of compiling or using an alternative source. – Prix Aug 14 '10 at 01:40
-
1Prix: that's an incomplete statement. It's not that using yum is doing it wrong, which this seems to imply. It's true in some cases, functionality is provided by a sub-package not pulled in by dependencies by default, or that for stability or legal reasons the package wasn't build with all features. But none of those things apply to ImageMagick's PNG and JPG support in CentOS. – mattdm Nov 16 '10 at 15:09
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
- 4,703
- 3
- 23
- 25
-
-
after you have done this what was the output of `identify -list format` did any error occur during the proccess ? – Prix Aug 20 '10 at 03: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
- 346
- 3
- 6
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.
- 6,550
- 1
- 25
- 48
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 ?
- 186
- 1
Centos has a binary release. I suggest you should go with that.
- 16,818
- 9
- 57
- 92
- 261
- 6
- 17