|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-20 04:11 UTC] mkoppanen@php.net
[2008-03-20 05:31 UTC] thetourist at gawab dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
Description: ------------ I am doing some picture composition with imagick in PHP. I translate the image before I do the composition. Depending on the amount of translation, I can get the image or the script fails. If I translate +1000 in the horizontal direction I get a valid image. If I translate -1000 units, the script fails and I get a zero size result. I am using Imagick 2.1.1, Ubuntu 7.10, PHP Version 5.2.3, Apache 2.2.4, ImageMagick 6.2.4. Any ideas would be appreciated. As to why I want to translate by -1000, I am doing some map alignment affine transforms and they can be quite complex - this is just a test case. Regards, TimSC Reproduce code: --------------- <?php //phpinfo(); //Create a blank blue image $image = new Imagick(); $col = new ImagickPixel(); $col->setColor ("blue"); $image->newImage( 640, 480, $col ); $image->setImageFormat( 'png' ); //Create a small green image $col->setColor ("green"); $image2 = new Imagick(); $image2->newImage( 100, 100, $col ); $image2->setImageFormat( 'png' ); //Composit green image onto blue image $ImagickDraw = new ImagickDraw(); $ImagickDraw->translate(-1000.0,0.0); //Translation step $ImagickDraw->composite(imagick::COMPOSITE_OVER,0,0,-1,-1,$image2); $image->drawImage( $ImagickDraw ); //Output image header( "Content-Type: image/{$image->getImageFormat()}" ); echo $image->getImageBlob( ); ?> Expected result: ---------------- Ideally the code example would return a valid image. Any composite that has been translated outside the image bounds should not be displayed. Or if that is not possible, I would expect Imagick to throw an exception if there was a problem rather than just silently failing. Actual result: -------------- Script appears to stop running when I call ImageickDraw::drawImage(...). A zero size file is returned to the browser.