1--TEST-- 2Test Imagick, distortImage 3--SKIPIF-- 4<?php 5$imageMagickRequiredVersion=0x675; 6require_once(dirname(__FILE__) . '/skipif.inc'); 7?> 8--FILE-- 9<?php 10 11$distortion = 1; 12 13 //X-of-destination = (sx*xs + ry+ys +tx) / (px*xs + py*ys +1) 14 //Y-of-destination = (rx*xs + sy+ys +ty) / (px*xs + py*ys +1) 15 16 // sx ry tx 17 // rx sy ty 18 // px py 19 20 $imagick = new \Imagick(); 21 $imagick->newPseudoImage(640, 480, "magick:logo"); 22 $points = array( 23 1.945622, 0.071451, 24 -12.187838, 0.799032, 25 1.276214, -24.470275, 0.006258, 0.000715 26 ); 27 $imagick->setimagebackgroundcolor("#fad888"); 28 $imagick->setImageVirtualPixelMethod( \Imagick::VIRTUALPIXELMETHOD_BACKGROUND); 29 $imagick->distortImage(\Imagick::DISTORTION_PERSPECTIVEPROJECTION, $points, TRUE); 30 $bytes = $imagick; 31 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 32 33echo "Ok"; 34?> 35--EXPECTF-- 36Ok