Skip to content

Commit f074ad2

Browse files
pierrejoyeweltling
authored andcommitted
ensure that the defined interpolation method is used by the generic scaling functions
1 parent 4d86b8b commit f074ad2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/gd/libgd/gd_interpolation.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,13 +1063,15 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
10631063
if (tmp_im == NULL) {
10641064
return NULL;
10651065
}
1066+
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
10661067
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10671068

10681069
dst = gdImageCreateTrueColor(new_width, new_height);
10691070
if (dst == NULL) {
10701071
gdFree(tmp_im);
10711072
return NULL;
10721073
}
1074+
gdImageSetInterpolationMethod(dst, src->interpolation_id);
10731075
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10741076
gdFree(tmp_im);
10751077

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

1091+
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10891092
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10901093

10911094
gdFree(tmp_im);

0 commit comments

Comments
 (0)