|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-04-25 11:46 UTC] armin dot a dot ruf at arcor dot de
Description: ------------ I tried to replicate one of the usage examples on the imagemagick site dealing with distorted gradients. This is my code: $img = new Imagick(); $img->newPseudoImage( 50, 100, "gradient:" ); $controlPoints = array( $img->getImageWidth()/2, $img->getImageHeight()/2, // center 1.0,1.0, // scaleing factors sx, sy 60, // rotation angle $img->getImageWidth()/2, $img->getImageHeight()/2 // translate to this position ); $img->distortImage( 3, $controlPoints, false);//Imagick::DISTORTION_SCALEROTATETRANSLATE The problem occurs in the last statement. Everthing works fine with the distortion constant 3. But if I use the distortion constant DISTORTION_SCALEROTATETRANSLATE to execute the SRT-method I get this error: Fatal error: Uncaught exception 'ImagickException' with message 'invalid argument for option Polynomial : 'Invalid order, should be 1 to 5, or 1.5' @ distort.c/GenerateCoefficients/371' in C:\xampp\htdocs\phptest\imagick\CanvasCreation\simpleGradient.php:149 Stack trace: #0 C:\xampp\htdocs\phptest\imagick\CanvasCreation\simpleGradient.php(149): Imagick->distortimage(7, Array, false)... It seems that the constant DISTORTION_SCALEROTATETRANSLATE is defined as 7. But it must be 3 as the enumeration shows in distort.h in the magick core files. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
Thank you for taking the time to write to us, but this is not a bug. The constant is defined in the following way on Imagick side: IMAGICK_REGISTER_CONST_LONG("DISTORTION_SCALEROTATETRANSLATE", ScaleRotateTranslateDistortion); It should match the constant from the ImageMagick core.