php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30662 Unable to fill true color image with a high-alpha color (imagealphablending on)
Submitted: 2004-11-02 16:10 UTC Modified: 2004-11-19 11:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ibrash at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.0.2 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ibrash at gmail dot com
New email:
PHP Version: OS:

 

 [2004-11-02 16:10 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-19 11:08 UTC] pajoye@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC