#27582 [NEW]: ImageFillToBorder act weird with alpha channel on alphablending image

From: Date: Fri, 12 Mar 2004 23:52:27 +0000
Subject: #27582 [NEW]: ImageFillToBorder act weird with alpha channel on alphablending image
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56370@lists.php.net to get a copy of this message
From:             panda dot management at free dot fr
Operating system: Windows XP
PHP version:      4.3.5RC3
PHP Bug Type:     GD related
Bug description:  ImageFillToBorder act weird with alpha channel on alphablending image

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 bug report at http://bugs.php.net/?id=27582&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27582&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27582&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27582&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27582&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27582&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27582&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27582&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27582&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27582&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27582&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27582&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27582&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27582&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27582&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27582&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27582&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27582&r=float


Thread (8 messages)

« previous php.bugs (#56370) next »