Download src/php/php-src/ext/gd/tests/bug27582_1.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gd/tests/bug27582_1.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gd/tests/bug27582_1.phpt
-
curl -L -o bug27582_1.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gd/tests/bug27582_1.phpt
721 Bytes
| --TEST-- | |
| Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color) | |
| --EXTENSIONS-- | |
| gd | |
| --SKIPIF-- | |
| if (!(imagetypes() & IMG_PNG)) { | |
| die("skip No PNG support"); | |
| } | |
| --FILE-- | |
| $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 | |