xref: /PHP-8.4/ext/gd/tests/gh17349.phpt (revision 2c658f42)
1--TEST--
2GH-17349 (Tiled truecolor filling looses single color transparency)
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7require_once __DIR__ . "/func.inc";
8
9$tile = imagecreatetruecolor(8, 8);
10$red = imagecolorallocate($tile, 255, 0, 0);
11imagefilledrectangle($tile, 0, 0, 7, 7, $red);
12imagecolortransparent($tile, $red);
13
14$im = imagecreatetruecolor(64, 64);
15$bg = imagecolorallocate($im, 255, 255, 255);
16imagefilledrectangle($im, 0, 0, 63, 63, $bg);
17imagecolortransparent($im, $bg);
18$fg = imagecolorallocate($im, 0, 0, 0);
19imageellipse($im, 31, 31, 50, 50, $fg);
20imagesettile($im, $tile);
21imagealphablending($im, false);
22imagefill($im, 31, 31, IMG_COLOR_TILED);
23
24test_image_equals_file(__DIR__ . "/gh17349.png", $im);
25?>
26--EXPECT--
27The images are equal.
28