Skip to content

Commit b54b6e3

Browse files
committed
ensure that the defined interpolation method is used by the generic scaling functions
1 parent 8d860c1 commit b54b6e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ PHP NEWS
3030
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
3131
by AddressSanitizer). (Remi).
3232

33+
- GD
34+
. Ensure that the defined interpolation method is used with the generic scaling methods (Pierre)
35+
3336
- OPCache:
3437
. Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4).
3538
(Terry Ellison)

ext/gd/libgd/gd_interpolation.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,15 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
10651065
if (tmp_im == NULL) {
10661066
return NULL;
10671067
}
1068+
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
10681069
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10691070

10701071
dst = gdImageCreateTrueColor(new_width, new_height);
10711072
if (dst == NULL) {
10721073
gdFree(tmp_im);
10731074
return NULL;
10741075
}
1076+
gdImageSetInterpolationMethod(dst, src->interpolation_id);
10751077
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10761078
gdFree(tmp_im);
10771079

@@ -1086,8 +1088,9 @@ gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const unsig
10861088
if (tmp_im == NULL) {
10871089
return NULL;
10881090
}
1089-
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
1091+
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
10901092

1093+
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10911094
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10921095

10931096
gdFree(tmp_im);

0 commit comments

Comments
 (0)