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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Apr 28 18:01:31 2024 UTC