Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.5

Bug #6011 Call to imagick_crop is using incorrect parameters
Submitted: 2005-11-18 23:10 UTC
From: gauthierm Assigned: pajoye
Status: Closed Package: Image_Transform
PHP Version: 5.0.5 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-18 23:10 UTC] gauthierm
Description: ------------ The PECL imagick extension uses different parameters for crop than Image_Transform uses in the Imagick2 driver. We are using version 0.9.11 of the imagick extension and ImageMagick 6.2.2.0. The PECL extension provides (as of 0.9.11): imagick_crop($resource, $x, $y, $width, $height) Image_Transform is trying to use: imagick_crop($resource, $x1, $y1, $x2, $y2) Here is a patch that fixes the behaviour in Image_Transform: http://worksintheory.org/files/pear/ImageTransform-imagick2-crop-20051118.diff Test script: --------------- $transform = new Image_Transform('Imagick2'); $transform->load('./my_image.jpg'); $transform->crop(10, 10, 20, 20); $transform->save('./new_image.jpg'); Expected result: ---------------- A new image that is 20 pixels x 20 pixels and offset 10 pixels, 10 pixels from the original image. Actual result: -------------- A new image that is 30 pixels x 30 pixels and offset 10 pixels, 10 pixels from the original image.

Comments

 [2005-11-19 03:28 UTC] gauthierm
This bug is a dupe of http://pear.php.net/bugs/6000 but contains a clearer description of the problem, and a patch to CVS.
 [2006-04-29 13:28 UTC] pajoye (Pierre-Alain Joye)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.