xref: /PHP-8.2/ext/gd/tests/bug38179.phpt (revision a375d547)
1--TEST--
2Bug #38179 (imagecopy from a palette to a truecolor image loses alpha channel)
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7$src = imagecreate(5,5);
8$c0 = imagecolorallocate($src, 255,255,255);
9$c1 = imagecolorallocatealpha($src, 255,0,0,70);
10
11imagealphablending($src, 0);
12imagefill($src, 0,0, $c1);
13
14$dst_tc = imagecreatetruecolor(5,5);
15imagealphablending($dst_tc, 0);
16
17imagecopy($dst_tc, $src, 0,0, 0,0, imagesx($src), imagesy($src));
18
19$p1 = imagecolorat($dst_tc, 3,3);
20printf("%X\n", $p1);
21
22imagedestroy($src); imagedestroy($dst_tc);
23?>
24--EXPECT--
2546FF0000
26