Annotation of embedaddon/php/ext/gd/tests/imagetruecolortopalette_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Testing imagetruecolortopalette() of GD library
3: --CREDITS--
4: Rafael Dohms <rdohms [at] gmail [dot] com>
5: --SKIPIF--
6: <?php
7: if (!extension_loaded("gd")) die("skip GD not present");
8: if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
9: ?>
10: --FILE--
11: <?php
12: $image = imagecreatetruecolor(150, 150);
13:
14: $a = imagecolorallocate($image,255,0,255);
15: $b = imagecolorallocate($image,0,255,255);
16:
17: $half = imagefilledarc ( $image, 75, 75, 70, 70, 0, 180, $a, IMG_ARC_PIE );
18: $half2 = imagefilledarc ( $image, 75, 55, 80, 70, 0, -180, $b, IMG_ARC_PIE );
19:
20: var_dump(imagetruecolortopalette($image, true, 2));
21:
22: ob_start();
23: imagepng($image, null, 9);
24: $img = ob_get_contents();
25: ob_end_clean();
26:
27: echo md5(base64_encode($img));
28: ?>
29: --EXPECT--
30: bool(true)
31: 0843f63ab2f9fddedd69b0b421686bc5
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>