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//  Rsrc = r / ( A*r3 + B*r2 + C*r + D )
14// This equation does NOT produce the 'reverse' the 'Barrel' distortion.
15// You can NOT use it to 'undo' the previous distortion.
16
17        $imagick = new \Imagick();
18    $imagick->newPseudoImage(640, 480, "magick:logo");
19
20        $points = array(
21            //0.2, 0.0, 0.0, 1.0
22            0.2, 0.1, 0.0, 1.0
23        );
24
25        $imagick->setimagebackgroundcolor("#fad888");
26        $imagick->setImageVirtualPixelMethod( \Imagick::VIRTUALPIXELMETHOD_EDGE);
27        $imagick->distortImage(\Imagick::DISTORTION_BARRELINVERSE, $points, TRUE);
28    $bytes = $imagick;
29    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
30
31echo "Ok";
32?>
33--EXPECTF--
34Ok