pajoye Tue Mar 14 03:46:59 2006 UTC Modified files: /php-src/ext/gd/tests bug36697.phpt /php-src/ext/gd/libgd gd_gif_out.c Log: - MFB: #36697, truecolor image lost im->transparent http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug36697.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/gd/tests/bug36697.phpt diff -u /dev/null php-src/ext/gd/tests/bug36697.phpt:1.2 --- /dev/null Tue Mar 14 03:46:59 2006 +++ php-src/ext/gd/tests/bug36697.phpt Tue Mar 14 03:46:59 2006 @@ -0,0 +1,31 @@ +--TEST-- +Bug #36697 (TrueColor transparency with GIF palette output). +--SKIPIF-- +<?php + if (!extension_loaded('gd')) { + die("skip gd extension not available\n"); + } + if (!GD_BUNDLED) { + die('skip external GD libraries may fail'); + } +?> +--FILE-- +<?php +$dest = dirname(__FILE__) . "/36697.gif"; + +$im = imagecreatetruecolor(192, 36); +$trans_color = imagecolorallocate($im, 255, 0, 0); +$color = imagecolorallocate($im, 255, 255, 255); +imagecolortransparent($im, $trans_color); +imagefilledrectangle($im, 0,0, 192,36, $trans_color); +$c = imagecolorat($im, 191,35); +imagegif($im, $dest); +imagedestroy($im); +$im = imagecreatefromgif($dest); +$c = imagecolorat($im, 191, 35); +$colors = imagecolorsforindex($im, $c); +echo $colors['red'] . ' ' . $colors['green'] . ' ' . $colors['blue']; [EMAIL PROTECTED]($dest); +?> +--EXPECT-- +255 0 0 http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_out.c?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/gd/libgd/gd_gif_out.c diff -u php-src/ext/gd/libgd/gd_gif_out.c:1.1 php-src/ext/gd/libgd/gd_gif_out.c:1.2 --- php-src/ext/gd/libgd/gd_gif_out.c:1.1 Thu Jul 22 22:38:59 2004 +++ php-src/ext/gd/libgd/gd_gif_out.c Tue Mar 14 03:46:59 2006 @@ -133,7 +133,7 @@ BitsPerPixel = colorstobpp(tim->colorsTotal); /* All set, let's do it. */ GIFEncode( - out, tim->sx, tim->sy, interlace, 0, transparent, BitsPerPixel, + out, tim->sx, tim->sy, tim->interlace, 0, tim->transparent, BitsPerPixel, tim->red, tim->green, tim->blue, tim); if (pim) { /* Destroy palette based temporary image. */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php