Centos – Adding PNG & JPG support to ImageMagick in PHP on CentOS

centosimagemagicklampPHP

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?

Best Answer

You would possible need to compile it from the source with the options to what you have misssing:

  1. yum remove ImageMagick
  2. yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
  3. wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.3-5.tar.gz
  4. tar zxvf ImageMagick-6.6.3-5.tar.gz
  5. cd ImageMagick-6.6.3-5
  6. ./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
  7. make clean
  8. make
  9. make install