ID: 21630 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Documentation problem Operating System: Linux 2.4.20 PHP Version: 4.3.0 New Comment:
http://www.boutell.com/gd/manual2.0.10.html "Pixel values are only interpolated if the destination image is a truecolor image. Otherwise, gdImageCopyResized is automatically invoked. " (doesn't this mean that it's a bug in GD library itself?) Previous Comments: ------------------------------------------------------------------------ [2003-01-14 14:00:08] [EMAIL PROTECTED] Hello, I confirm (if necessary) the Derick's comment. This a problem due to palette images limitations (255+1 colors). Resampling or filtering an image needs commonly more colors than 255, a kind of approximation is used to calc the new resampled pixel and its color, with a palette image we try to allocate a new color, if that failed, we choose the closest (in theory), the closest computed color is not always the closest visual color. That produces weird result, like blank (or visually blank) images. You can reproduce this problem with imagerotate used with a palette image (imagecreate), allocate 3 colors, draw 2 differents boxes, and rotate the image with a custom angle (not a quarter angle), you will get a blank image or near blank. Hope that helps, pierre ------------------------------------------------------------------------ [2003-01-14 13:32:25] [EMAIL PROTECTED] Should be documented (better) then. Derick ------------------------------------------------------------------------ [2003-01-14 13:20:41] [EMAIL PROTECTED] I've managed to resolve this, it's not a bug with the ImageCreateFromGIF function, but the ImageCopyResampled, the blank image needs to be created with ImageCreateTrueColor or the resultant image is blank. Not sure whether this becomes a bogus bug or whether the real issue is with ImageCopyResampled? In fact, I've just looked at the user notes for ImageCopyResampled and people are saying there to use Truecolor. ------------------------------------------------------------------------ [2003-01-14 05:33:10] [EMAIL PROTECTED] Just to confirm, I just checked in phpinfo, and I am using the bundled GD (you made me wonder whether I had built php correctly). ------------------------------------------------------------------------ [2003-01-14 05:19:12] [EMAIL PROTECTED] tar located at http://support.brendata.co.uk/phpbug21630.tgz can be run from the command line. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21630 -- Edit this bug report at http://bugs.php.net/?id=21630&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php