#27582 [Ver->Csd]: ImageFillToBorder act weird with alpha channel on alphablending image
| From: | pajoye@php.net | Date: | Sat, 13 Mar 2004 18:31:30 +0000 |
| Subject: | #27582 [Ver->Csd]: ImageFillToBorder act weird with alpha channel on alphablending image | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56400@lists.php.net to get a copy of this message | ||
ID: 27582
Updated by: pajoye@php.net
Reported By: panda dot management at free dot fr
-Status: Verified
+Status: Closed
Bug Type: GD related
Operating System: Windows XP
PHP Version: 4.3.5RC3
-Assigned To:
+Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
This bug is fixed in HEAD (php5). It will be fixed too in php4
(PHP_4_3) later this weekend.
thanks for the small reproduce script,
pierre
Previous Comments:
------------------------------------------------------------------------
[2004-03-13 05:10:55] pajoye@php.net
Hello,
Verified with HEAD. Segfault in libgd function, infinite recursion.
I will try to fix it asap.
pierre
------------------------------------------------------------------------
[2004-03-13 05:03:55] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-03-12 18:52:27] panda dot management at free dot fr
Description:
------------
Hello!
ImageFillToBorder seems to act strangely (no output) when using alpha
channel (?) on color and / or bordercolor values, on an alphablending
image.
Configuration:
**************
winxp
apache 2.0.48
php 4.3.4 / 4.3.5RC3
gd2 module loaded
Reproduce code:
---------------
<?php
$im = ImageCreateTrueColor(10, 10);
imagealphablending($im, true);
imagesavealpha($im, false);
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
$color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
ImageFillToBorder($im, 5, 5, $bordercolor, $color);
?>
Expected result:
----------------
Do work as supposed to, or output some error.
Actual result:
--------------
Actual result:
**************
Browser hangs and output an alert "Document contains no data".
I'm not experienced enough to give you more debug details... but it
obviously break something...
Additionnal comment:
**************
The values that trigger the bug seems to be pretty much random.
You can reproduce the problem with:
$bordercolor=ImageColorAllocateAlpha($im, 0, 254, 0, 0);
$color = ImageColorAllocateAlpha($im, 0, 255, 255, 75);
Or even reproduce it with:
$bordercolor=ImageColorAllocate($im, 0, 254, 0);
$color = ImageColorAllocateAlpha($im, 0, 255, 255, 75);
(wich is much more logical on an alphablending image...)
But odly it works ok with:
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 0);
$color = ImageColorAllocateAlpha($im, 0, 255, 255, 75);
I can't find any coherence in the problematic values, except that they
involve alpha channel.
If this is a doc problem, or if I missed something, please forgive this
report...
Anyway, long life to php.
Olivier
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27582&edit=1