Annotation of embedaddon/php/ext/gd/tests/bug36697.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #36697 (TrueColor transparency with GIF palette output).
                      3: --SKIPIF--
                      4: <?php
                      5:        if (!extension_loaded('gd')) {
                      6:                die("skip gd extension not available\n");
                      7:        }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: $dest = dirname(__FILE__) . "/36697.gif";
                     12: 
                     13: $im = imagecreatetruecolor(192, 36);
                     14: $trans_color = imagecolorallocate($im, 255, 0, 0);
                     15: $color = imagecolorallocate($im, 255, 255, 255);
                     16: imagecolortransparent($im, $trans_color);
                     17: imagefilledrectangle($im, 0,0, 192,36, $trans_color);
                     18: $c = imagecolorat($im, 191,35);
                     19: imagegif($im, $dest);
                     20: imagedestroy($im);
                     21: $im = imagecreatefromgif($dest);
                     22: $c = imagecolorat($im, 191, 35);
                     23: $colors = imagecolorsforindex($im, $c);
                     24: echo $colors['red'] . ' ' . $colors['green'] . ' ' . $colors['blue'];
                     25: @unlink($dest);
                     26: ?>
                     27: --EXPECT--
                     28: 255 0 0

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>