php-src/ext/gd/tests/bug27582_1.phpt
Christoph M. Becker a375d54785
Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

25 lines
634 B
PHP

--TEST--
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
--EXTENSIONS--
gd
--FILE--
<?php
$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