PHP Support ImageMagick

Source: Internet
Author: User
Tags imagemagick
What can ImageMagick do?

A php extension that can be used by PHP to invoke the ImageMagick feature.  Using this extension allows PHP to have the same functionality as ImageMagick. ImageMagick is a powerful, stable and free toolset and development package that can be used to read, write, and process image files in more than 185 basic formats, including popular TIFF, JPEG, GIF, PNG, PDF, and PHOTOCD formats. With ImageMagick, you can dynamically generate images based on the needs of your Web application, and you can resize, rotate, sharpen, subtract, or add effects to a (or a group of) images and save the results of the operation in the same format or other format.

How does php install?

Preparatory work:
Imagemagick-6.5.5-6-q16-windows-dll.exe

Download Address: http://image_magick.veidrodis.com/image_magick/binaries/You can find the version you need, generally you will choose a newer, But I downloaded the imagemagick-6.5.5-6-q16-windows-dll.exe.
All you need is a DLL file Php_imagick.dll if your PHP version is php 5.2.x, download here: http://valokuva.org/outside-blog-content/ imagick-windows-builds/080709/(i downloaded php_imagick_dyn-q16.dll this file)
If it's PHP 5.3.x, this is what you need: http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/

Installation process:
Installation: Imagemagick-6.5.7-7-q16-windows-dll.exe
Then rename the Php-5.2.4_magickwand_q16_st.dll to Php_imagick.dll and copy it to the PHP ext folder.
Adding settings to the php.ini file
Extension=php_imagick.dll
After viewing phpinfo () There is no Imagick column, if you have some words can be tested.


Php_imagick Program Examples

1. Create a thumbnail image and display it
Header (' Content-type:image/jpeg ');
$image = new Imagick (' image.jpg ');
If 0 is provided as a width or height parameter,//aspect ratio is maintained
$image->thumbnailimage (100, 0);
Echo $image;
?>

2. Create a thumbnail in a directory and save
$images = new Imagick (Glob (' images
$im = new Imagick ("Example.gif");

foreach ($im as $frame) {

$frame->thumbnailimage (50, 50);

$frame->setimagepage (50, 50, 0, 0);
}
$im->writeimages ("Example_small.gif", true);
?>


Youth should be like this Bloom game test: The Three Kingdoms Period who is your best brother!! You have to believe in the constellation secrets
  • 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.