xref: /PHP-7.0/ext/gd/tests/bug64641.phpt (revision 54293d21)
1--TEST--
2Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die("skip gd extension not available\n");
6if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
7	die("skip test requires GD 2.2.2 or higher");
8}
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/similarity.inc';
13
14$im = imagecreatetruecolor(640, 480);
15
16$points = array(
17	100, 100,
18	100, 200,
19	100, 300
20);
21imagefilledpolygon($im, $points, 3, 0xFFFF00);
22
23$points = array(
24	300, 200,
25	400, 200,
26	500, 200
27);
28imagefilledpolygon($im, $points, 3, 0xFFFF00);
29
30$ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
31if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
32	echo "IDENTICAL";
33} else {
34	echo "DISSIMILARITY: $diss";
35}
36imagedestroy($ex);
37
38imagedestroy($im);
39?>
40--EXPECT--
41IDENTICAL
42