2004-03-14 03:21:26 +00:00
|
|
|
--TEST--
|
2005-04-03 11:15:39 +00:00
|
|
|
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
|
2004-03-14 03:21:26 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
|
|
|
if (!GD_BUNDLED) die('skip external GD libraries always fail');
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
/* $id$ */
|
2004-04-08 08:39:41 +00:00
|
|
|
$dest = dirname(realpath(__FILE__)) . '/bug27582.png';
|
2004-03-14 03:21:26 +00:00
|
|
|
@unlink($dest);
|
|
|
|
$im = ImageCreateTrueColor(10, 10);
|
|
|
|
imagealphablending($im, true);
|
2005-04-25 11:36:24 +00:00
|
|
|
imagesavealpha($im, true);
|
2004-03-14 03:21:26 +00:00
|
|
|
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
|
|
|
|
$color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
|
|
|
|
ImageFillToBorder($im, 5, 5, $bordercolor, $color);
|
|
|
|
imagepng($im, $dest);
|
2005-04-25 11:36:24 +00:00
|
|
|
|
|
|
|
$im2 = imagecreatefrompng($dest);
|
|
|
|
$col = imagecolorat($im2, 5, 5);
|
|
|
|
$color = imagecolorsforindex($im2, $col);
|
|
|
|
echo $color['alpha'];
|
2004-04-08 08:39:41 +00:00
|
|
|
@unlink($dest);
|
2004-03-14 03:21:26 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
2005-04-25 11:36:24 +00:00
|
|
|
1
|