1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/gd/tests/gd223.phpt
Christoph M. Becker 47683487f8 Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
We port the respective upstream fix[1].  We only run the test against
bundled libgd, since external libgd may yield different results.

Cf. <2b26be874d>.

Closes GH-17380.
2025-01-06 20:37:23 +01:00

27 lines
577 B
PHP

--TEST--
libgd bug 223 (gdImageRotateGeneric() does not properly interpolate)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!GD_BUNDLED) die("skip only for bundled libgd");
?>
--FILE--
<?php
require_once __DIR__ . "/func.inc";
$im = imagecreatetruecolor(64, 64);
for ($j = 0; $j < 64; $j++) {
for ($i = 0; $i < 64; $i++) {
imagesetpixel($im, $i, $j, ($i % 2 || $j % 2) ? 0x000000 : 0xffffff);
}
}
imagesetinterpolation($im, IMG_BICUBIC);
$im = imagerotate($im, 45, 0xff0000);
test_image_equals_file(__DIR__ . "/gd223.png", $im);
?>
--EXPECT--
The images are equal.