Imagick distort error.
Posted: 2009-07-25T19:52:23-07:00
I'm trying to run a test script but I get error.
My script is like this:
$im = new Imagick($file);
$controlPoints = array( 0, 0,
$ax,$ay,
10,$minheight,
$bx,$by,
$minwidth, 0,
$cx,$cy,
$minwidth,$minheight,
$dx,$nem);
$im->distortImage(Imagick::DISTORTION_PERSPECTIVEPROJECTION, $controlPoints, true);
$im->writeImage("result.jpg");
$im->destroy();
Every time I run it I get this error message:
Fatal error: Uncaught exception 'ImagickException' with message 'Can't read argument array' in D:\path-to-script\script.php:196 Stack trace: #0 D:\path-to-script\script.php(196): Imagick->distortimage(6, Array, true) #1 D:\path-to-script\script.php(104): include('D:\path-to-script...') #2 D:\path-to-script\script.php(191): include('D:\path-to-script...') #3 {main} thrown in D:\path-to-script\script.php on line 196
What is this error. What can I do to solve it?
If I put the strings values instead the string name inside of the array it works perfect.
My script is like this:
$im = new Imagick($file);
$controlPoints = array( 0, 0,
$ax,$ay,
10,$minheight,
$bx,$by,
$minwidth, 0,
$cx,$cy,
$minwidth,$minheight,
$dx,$nem);
$im->distortImage(Imagick::DISTORTION_PERSPECTIVEPROJECTION, $controlPoints, true);
$im->writeImage("result.jpg");
$im->destroy();
Every time I run it I get this error message:
Fatal error: Uncaught exception 'ImagickException' with message 'Can't read argument array' in D:\path-to-script\script.php:196 Stack trace: #0 D:\path-to-script\script.php(196): Imagick->distortimage(6, Array, true) #1 D:\path-to-script\script.php(104): include('D:\path-to-script...') #2 D:\path-to-script\script.php(191): include('D:\path-to-script...') #3 {main} thrown in D:\path-to-script\script.php on line 196
What is this error. What can I do to solve it?
If I put the strings values instead the string name inside of the array it works perfect.