#30662 [NEW]: Unable to fill true color image with a high-alpha color (imagealphablending on)

From: Date: Tue, 02 Nov 2004 15:10:44 +0000
Subject: #30662 [NEW]: Unable to fill true color image with a high-alpha color (imagealphablending on)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68633@lists.php.net to get a copy of this message
From: ibrash at gmail dot com Operating system: Irrelevant PHP version: 5.0.2 PHP Bug Type: GD related Bug description: Unable to fill true color image with a high-alpha color (imagealphablending on) 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 bug report at http://bugs.php.net/?id=30662&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30662&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30662&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30662&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30662&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30662&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30662&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30662&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30662&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30662&r=support Expected behavior: http://bugs.php.net/fix.php?id=30662&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30662&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30662&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30662&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30662&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30662&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30662&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30662&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30662&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30662&r=mysqlcfg

« previous php.bugs (#68633) next »