#30662 [Opn->Csd]: Unable to fill true color image with a high-alpha color (imagealphablending on)
| From: | pajoye@php.net | Date: | Fri, 19 Nov 2004 10:08:07 +0000 |
| Subject: | #30662 [Opn->Csd]: Unable to fill true color image with a high-alpha color (imagealphablending on) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69250@lists.php.net to get a copy of this message | ||
ID: 30662
Updated by: pajoye@php.net
Reported By: ibrash at gmail dot com
-Status: Open
+Status: Closed
Bug Type: GD related
Operating System: Irrelevant
PHP Version: 5.0.2
-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.
Fixed in HEAD. Merge to 5.0.x branch over the weekend.
--Pierre
Previous Comments:
------------------------------------------------------------------------
[2004-11-02 16:10:38] ibrash at gmail dot com
Description:
------------
It seems that imagefill doesn't deal well with highly-transparent
colors, causing PHP to use 100% of CPU and never finish executing the
imagefill (i.e., seems like an infinite loop). Anything at or above an
alpha setting of 85 in the imagecolorallocatealpha call seems to trigger
this behavior.
Tested on both Linux (built from source) and Windows XP (php.net
packaged version) with same results.
Configure line on Linux is
./configure --with-gd --with-jpeg-dir --with-zlib-dir
Reproduce code:
---------------
<?php
$im = imagecreatetruecolor(400, 400);
imagealphablending($im, true);
$background = imagecolorallocatealpha($im, 255, 255, 255, 127);
imagefill($im, 0, 0, $background);
?>
Expected result:
----------------
Script to run to completion.
Actual result:
--------------
Script never ends (unless max_execution_time is set, of course)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30662&edit=1