PHP Image Processing (2) graphicsmagick installation extension and usage

Source: Internet
Author: User
What is graphicsmagick?
How to install graphicsmagick?
PHP Image Processing (I) graphicsmagick introduction and Installation

Graphicsmagick PHP extension Installation


Operating System: centos 5.6 environment: Lamp Programming Language : PHP: gmagick documentation: gmagick


Procedure

1: install PHP extension gmagick-1.0.9

#Install Extension
Tar-zxvf gmagick-1.0.9b1.tgz
CD gmagick-1.0.9b1
/Usr/local/PHP/bin/phpize
./Configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config
Make
Make install

2. Modify the php. ini file.

 #  Modify configuration file  
VI/usr/local/PHP/etc/PHP. ini
# Extension_dir = './' change the path
Extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613/gmagick. So"
# Enable gmagick Extension
Extension = gmagick. So
# Restart Apache
/Usr/local/apache2/bin/apachectl restart

3: display the configuration information of the PHP server and check whether the extension is installed.

 
#Create a file
VI/usr/local/apache2/htdocs/index. php
#Write
<? PHP
Phpinfo();
?>

Graphicsmagick PHP extension usage

Procedure

1: Prepare an image.Sun honglei

 
<? PHP
#If an extension error is reported, install LibPNG, libjpeg, and libmcrypt in the default directory.

$ Image=NewGmagick('1.jpg ');

$ Image-> Borderimage ('blue', 3,3)-> oilpaintimage (0.1 );

$ Image-> Write('2.jpg ');
?>

<? PHP
$ Image=NewGmagick('1.jpg ');

//Change image size
$ Image-> Resizeimage (100,200 );

$ Image-> Write('2.jpg ');
?>

For more information, see the relevant documentation above.


Graphicsmagick PHP extension Installation

graphicsmagick PHP extension

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.