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 18:10 UTC Modified: 2006-04-29 08:28 UTC
From: gauthierm Assigned: pajoye
Status: Closed Package: Image_Transform
PHP Version: 5.0.5 OS: Linux
Roadmaps: (Not assigned)    

 [2005-11-18 18: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 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: 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.


 [2005-11-18 22:28 UTC] gauthierm
This bug is a dupe of but contains a clearer description of the problem, and a patch to CVS.
 [2006-04-29 08:28 UTC] pajoye (Pierre-Alain Joye)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.