#windows下 PHP5.5.6 + imagick extension 1, install Imagemagick-6.8.7-7-q16-x64-dll.exe first. Download Address: Http://www.imagemagick.org/script/binary-releases.php#windows can select a different version. 2, decompression Php_imagick-3.1.2-5.5-ts-vc11-x64.zip, will php_imagick.dll into the ext directory of PHP. Can download according to Imagick version, download address: Http://pecl.php.net/package/imagick Click DLL, you can enter the corresponding PHP version. When downloading, note non-thread-safe and Thread-safe, which apply to IIS, and the latter for Apache. 3, open php.ini, add Extension=php_imagick.dll, restart Apache.
Instructions for use:
<?php
$image =new imagick ("1.jpg");
$array = $image->getimageresolution (); Returns the image resolution, x and Y axis information
print_r ($array);
Output array ([x] => [y] =>)
?>
Function Description: $images = new Imagick ("ALIM2382. JPG ");//New Imagick class
$images->getimageheight ()//Get Picture high
$images->getimagewidth ()//Get picture width
$images->thumbnailimage (100,100);////change the size of the picture
$images->writeimages ("ALIM2382. JPG, True);//write an image or image sequence
$images->writeimage ("ALIM2382. JPG ");/write an image
$images->destroy ()//Destroy picture
$images->borderimage (New Imagickpixel ("Red"), 3, 3);//Set picture border red, border 3
$images->modulateimage (50, 0, 0); Control brightness, saturation, hue
$images->compositeimage ($im, Imagick::composite_over, 10, 20);//To fit two images together.
$images->setimageformat (' jpeg ');//Set Picture format
$images->getimageresolution ()//Return image resolution, x and Y axis information
$images->getimageunits ()//Return image resolution unit
$images->resampleimage ()//to resample at the desired resolution
$images->setimageresolution ()/Set resolution
Set resolution Unit $images->setimageunits ()/
echo $images//Display
Please refer to Http://cn.php.net/imagick website