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
14// The arguments needed for the 'Barrel' distort method. Generally you supply
15// 3 or 4 values only...
16// A   B   C   [ D   [ X , Y ] ]
17// The optional X,Y arguments provide an optional 'center' for the radial distortion,
18// otherwise it defaults to the exact center of the image given (regardless of its virtual offset).
19// The coefficients are designed so that if all four A to D values, add up to '1.0', the minimal
20// width/height of the image will not change. For this reason if D (which controls the overall
21// scaling of the image) is not supplied it will be set so all four values do add up to '1.0'.
22
23        $imagick = new \Imagick();
24    $imagick->newPseudoImage(640, 480, "magick:logo");
25
26        $points = array(
27            //0.2, 0.0, 0.0, 1.0
28            0.4, 0.6, 0.0, 1.0
29        );
30
31        $imagick->setimagebackgroundcolor("#fad888");
32        $imagick->setImageVirtualPixelMethod( \Imagick::VIRTUALPIXELMETHOD_EDGE);
33        $imagick->distortImage(\Imagick::DISTORTION_BARREL, $points, TRUE);
34    $bytes = $imagick;
35    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
36
37echo "Ok";
38?>
39--EXPECTF--
40Ok