mirror of
https://github.com/php/php-src.git
synced 2026-04-20 22:41:20 +02:00
While `imagesetinterpolation()` is available as of PHP 5.5.0, there is no according getter function, so users would have to track the current interpolation method manually. To remedy this, we introduce `imagegetinterpolation()` as thin wrapper for `gdImageGetInterpolationMethod()` (which has been introduced with libgd 2.1.1), and use `im->interpolation_id` as fallback for older libgd. Since our bundled libgd does not yet have this function, we add it. We also simplify the recently introduced bug79068.phpt, where it is sufficient to check that the interpolation method has not been changed.
18 lines
474 B
PHP
18 lines
474 B
PHP
--TEST--
|
|
Bug #79068 (gdTransformAffineCopy() changes interpolation method)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$src = imagecreatetruecolor(100, 100);
|
|
imagefilledrectangle($src, 0, 0, 99, 99, 0xffffff);
|
|
imageline($src, 10, 10, 90, 90, 0x000000);
|
|
imagesetinterpolation($src, IMG_BSPLINE);
|
|
imageaffine($src, [1, 1, 1, 1, 1, 1]);
|
|
var_dump(imagegetinterpolation($src) === IMG_BSPLINE);
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|