summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug38179.phpt
blob: 8adc38922868b0e6fd5a8a47b422460746391bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #38179 (imagecopy from a palette to a truecolor image loses alpha channel) 
--SKIPIF--
<?php
        if (!function_exists('imagecopy')) die("skip gd extension not available\n");
?>
--FILE--
<?php
$src = imagecreate(5,5);
$c0 = imagecolorallocate($src, 255,255,255);
$c1 = imagecolorallocatealpha($src, 255,0,0,70);

imagealphablending($src, 0);
imagefill($src, 0,0, $c1);

$dst_tc = imagecreatetruecolor(5,5);
imagealphablending($dst_tc, 0);

imagecopy($dst_tc, $src, 0,0, 0,0, imagesx($src), imagesy($src));

$p1 = imagecolorat($dst_tc, 3,3);
printf("%X\n", $p1);

imagedestroy($src); imagedestroy($dst_tc);
?>
--EXPECT--
46FF0000