What can I do if PHP supports ImageMagick?
A php extension that allows PHP to call the ImageMagick function. With this extension, PHP can have the same functions as ImageMagick. ImageMagick is a powerful, stable, and free toolkit that can be used to read, write, and process image files in over 185 basic formats, including popular TIFF, JPEG, GIF, PNG, PDF, and PhotoCD. By using ImageMagick, you can dynamically generate images based on the needs of web applications. you can also resize, rotate, sharpen, subtract, or add special effects to one or more images, save the operation results in the same format or other formats.
How to install PHP?
Preparations:
ImageMagick-6.5.5-6-Q16-windows-dll.exe
: Http: // image_magick.veidrodis.com/image_magick/binaries/clusters
All you need is a DLL file php_Imagick.dll. if your PHP version is PHP 5.2.x, download it here: http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/(I downloaded the php_imagick_dyn-Q16.dll file)
For 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
Rename the php-5.2.4_magickwand_q16_st.dll to php_imagick.dll and copy it to the ext folder of php.
Add settings in the php. ini file
Extension = php_imagick.dll
Check whether there is an imagick column in phpinfo (). if there is one, you can test it.
Php_imagick program example
1. create a thumbnail 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 under the Directory and save it
$ 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 );
?>
In this way, you should test the game: Who is your best brother in the Three Kingdoms period !! Secret of your horoscope