mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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.
27 lines
577 B
PHP
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.
|