2
libgd #100 (spurious horizontal line drawn by gdImageFilledPolygon)
5
if (!extension_loaded('gd')) die("skip gd extension not available\n");
6
if (!GD_BUNDLED) die("skip requires bundled GD library\n");
10
$im = imagecreatetruecolor(256, 256);
12
$white = imagecolorallocatealpha($im, 255, 255, 255, 10);
13
$black = imagecolorallocatealpha($im, 0, 0, 0, 10);
14
$red = imagecolorallocatealpha($im, 255, 0, 0, 10);
15
$green = imagecolorallocatealpha($im, 0, 255, 0, 10);
16
$blue = imagecolorallocatealpha($im, 0, 0, 255, 10);
17
$yellow = imagecolorallocatealpha($im, 255, 255, 0, 10);
18
$cyan = imagecolorallocatealpha($im, 0, 255, 255, 10);
19
$magenta = imagecolorallocatealpha($im, 255, 0, 255, 10);
20
$purple = imagecolorallocatealpha($im, 100, 0, 100, 10);
22
imagefilledrectangle($im, 0, 0, 255, 255, $white);
36
imagefilledpolygon($im, $points, 5, $yellow);
38
// left-facing M not on baseline
48
($left+$right)/2, ($top+$bot)/2
50
imagefilledpolygon($im, $points, 5, $purple);
52
// left-facing M on baseline
62
($left+$right)/2, ($top+$bot)/2
64
imagefilledpolygon($im, $points, 5, $magenta);
66
// left-facing M on ceiling
76
($left+$right)/2, ($top+$bot)/2
78
imagefilledpolygon($im, $points, 5, $blue);
83
$diamond = array($x-$d, $y, $x, $y+$d, $x+$d, $y, $x, $y-$d);
84
imagefilledpolygon($im, $diamond, 4, $green);
88
$diamond = array($x-$d, $y, $x, $y+$d, $x+$d, $y, $x, $y-$d);
89
imagefilledpolygon($im, $diamond, 4, $red);
93
$diamond = array($x-$d, $y, $x, $y+$d, $x+$d, $y, $x, $y-$d);
94
imagefilledpolygon($im, $diamond, 4, $cyan);
96
// M (bridge) not touching bottom boundary
104
$x+$d, ($top+$bot)/2,
107
imagefilledpolygon($im, $points, 5, $black);
111
$png = ob_get_contents();
119
2e6cf558bb4dadf60c8b608d5f8cda4e