Annotation of embedaddon/php/ext/gd/tests/bug38179.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #38179 (imagecopy from a palette to a truecolor image loses alpha channel)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!function_exists('imagecopy')) die("skip gd extension not available\n");
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: $src = imagecreate(5,5);
! 10: $c0 = imagecolorallocate($src, 255,255,255);
! 11: $c1 = imagecolorallocatealpha($src, 255,0,0,70);
! 12:
! 13: imagealphablending($src, 0);
! 14: imagefill($src, 0,0, $c1);
! 15:
! 16: $dst_tc = imagecreatetruecolor(5,5);
! 17: imagealphablending($dst_tc, 0);
! 18:
! 19: imagecopy($dst_tc, $src, 0,0, 0,0, imagesx($src), imagesy($src));
! 20:
! 21: $p1 = imagecolorat($dst_tc, 3,3);
! 22: printf("%X\n", $p1);
! 23:
! 24: imagedestroy($src); imagedestroy($dst_tc);
! 25: ?>
! 26: --EXPECTF--
! 27: 46FF0000
! 28:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>