mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fix #79068: gdTransformAffineCopy() changes interpolation method
We port
<9088591eae
>.
This commit is contained in:
parent
2c5860517c
commit
4bec59f175
2
NEWS
2
NEWS
@ -25,6 +25,8 @@ PHP NEWS
|
||||
. Fixed bug #78923 (Artifacts when convoluting image with transparency).
|
||||
(wilson chen)
|
||||
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
|
||||
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
|
||||
(cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
|
||||
|
@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
gdPointF pt, src_pt;
|
||||
gdRect bbox;
|
||||
int end_x, end_y;
|
||||
gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
|
||||
gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
|
||||
interpolation_method interpolation_bak;
|
||||
|
||||
/* These methods use special implementations */
|
||||
|
21
ext/gd/tests/bug79068.phpt
Normal file
21
ext/gd/tests/bug79068.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #79068 (gdTransformAffineCopy() changes interpolation method)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/func.inc';
|
||||
|
||||
$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]);
|
||||
$dst = imagerotate($src, 80, 0xffffff);
|
||||
|
||||
test_image_equals_file(__DIR__ . '/bug79068.png', $dst);
|
||||
?>
|
||||
--EXPECT--
|
||||
The images are equal.
|
BIN
ext/gd/tests/bug79068.png
Normal file
BIN
ext/gd/tests/bug79068.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 798 B |
Loading…
Reference in New Issue
Block a user