mirror of
https://github.com/php/php-src.git
synced 2024-10-20 07:53:58 +00:00
f150ee9ab5
some floating points issue can end to different colors (+/- 1/255) tests should work again now.
29 lines
798 B
PHP
29 lines
798 B
PHP
--TEST--
|
|
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
|
|
--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$ */
|
|
$dest = dirname(realpath(__FILE__)) . '/bug27582.png';
|
|
@unlink($dest);
|
|
$im = ImageCreateTrueColor(10, 10);
|
|
imagealphablending($im, true);
|
|
imagesavealpha($im, true);
|
|
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
|
|
$color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
|
|
ImageFillToBorder($im, 5, 5, $bordercolor, $color);
|
|
imagepng($im, $dest);
|
|
|
|
$im2 = imagecreatefrompng($dest);
|
|
$col = imagecolorat($im2, 5, 5);
|
|
$color = imagecolorsforindex($im2, $col);
|
|
echo $color['alpha'];
|
|
@unlink($dest);
|
|
?>
|
|
--EXPECT--
|
|
1
|