Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #64641 (imagefilledpolygon doesn't draw horizontal line) --EXTENSIONS-- gd --..

Decoded Output download

--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");
}
?>
--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

Did this file decode correctly?

Original Code

--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");
}
?>
--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

Function Calls

None

Variables

None

Stats

MD5 b861670621b5be39d0651cb22548fa4b
Eval Count 0
Decode Time 103 ms