Linux under Php+imagemagick supports images in WEBP format

Source: Internet
Author: User
Tags imagemagick webp

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.