2016-06-19 19:54:55 +08:00
|
|
|
--TEST--
|
|
|
|
Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
2016-08-17 20:04:08 +08:00
|
|
|
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
|
|
|
|
die("skip test requires GD 2.2.2 or higher");
|
|
|
|
}
|
2016-06-19 19:54:55 +08:00
|
|
|
?>
|
|
|
|
--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
|