forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbug64641.phpt
45 lines (40 loc) · 841 Bytes
/
bug64641.phpt
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
42
43
44
45
--TEST--
Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . '/similarity.inc';
$im = imagecreatetruecolor(640, 480);
$points = array(
100, 100,
100, 200,
100, 300
);
imagefilledpolygon($im, $points, 0xFFFF00);
$points = array(
300, 200,
400, 200,
500, 200
);
imagefilledpolygon($im, $points, 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