summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug64641.phpt
blob: 713daaf85e3615774f54eea34bb97e6822b6f703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
	die("skip test requires GD 2.2.2 or higher");
}
?>
--FILE--
<?php
require_once __DIR__ . '/similarity.inc';

$im = imagecreatetruecolor(640, 480);

$points = array(
	100, 100,
	100, 200,
	100, 300
);
imagefilledpolygon($im, $points, 3, 0xFFFF00);

$points = array(
	300, 200,
	400, 200,
	500, 200
);
imagefilledpolygon($im, $points, 3, 0xFFFF00);

$ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
	echo "IDENTICAL";
} else {
	echo "DISSIMILARITY: $diss";
}
imagedestroy($ex);

imagedestroy($im);
?>
--EXPECT--
IDENTICAL