#50269 [Bgs]: getting and setting (new) transparant color error
| From: | ericbruggema at hotmail dot com | Date: | Mon, 23 Nov 2009 10:57:54 +0000 |
| Subject: | #50269 [Bgs]: getting and setting (new) transparant color error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144952@lists.php.net to get a copy of this message | ||
ID: 50269
User updated by: ericbruggema at hotmail dot com
Reported By: ericbruggema at hotmail dot com
Status: Bogus
Bug Type: GD related
Operating System: WinXP Sp3 dutch
PHP Version: 5.3SVN-2009-11-23 (SVN)
Assigned To: pajoye
New Comment:
er?? the current image will be copied to a new image (thumb) but i'd
like to keep the current 'transparant' color, but this gives an error...
looks like the index for the transparant color (current image) doesn't
exists in the color palette... (current image)
Previous Comments:
------------------------------------------------------------------------
[2009-11-23 10:55:06] pajoye@php.net
if the image is a palette image and has only 10 colors, trying to use
the color 11 will obviously fail.
------------------------------------------------------------------------
[2009-11-23 10:39:51] ericbruggema at hotmail dot com
Description:
------------
The problem is that when reading a transparant color from an existing
image in some cases can't be used to set the transparant color for new
images.
Reproduce code:
---------------
$im = imagecreatefromgif("image.gif");
$trnprt_indx = imagecolortransparent($im);
$trnprt_color = @imagecolorsforindex($im, $trnprt_indx); // error line
Expected result:
----------------
imagecolorsforindex() [<a
href='function.imagecolorsforindex'>function.imagecolorsforindex</a>]:
Color index 251 out of range
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50269&edit=1