1 /*
2 * Test that gdTransformAffineCopy() does not change the interpolation method
3 *
4 * See <https://github.com/libgd/libgd/issues/585>
5 */
6
7 #include "gd.h"
8 #include "gdtest.h"
9
main()10 int main()
11 {
12 gdImagePtr src, dst;
13 gdRect rect = {0, 0, 8, 8};
14 double matrix[] = {1, 1, 1, 1, 1, 1};
15 int res;
16 gdInterpolationMethod old_m, new_m;
17
18 src = gdImageCreateTrueColor(8, 8);
19 gdTestAssert(src != NULL);
20 dst = gdImageCreateTrueColor(8, 8);
21 gdTestAssert(dst != NULL);
22
23 res = gdImageSetInterpolationMethod(src, GD_CATMULLROM);
24 gdTestAssert(res == GD_TRUE);
25 old_m = gdImageGetInterpolationMethod(src);
26 gdTransformAffineCopy(dst, 0, 0, src, &rect, matrix);
27 new_m = gdImageGetInterpolationMethod(src);
28 gdTestAssert(new_m == old_m);
29
30 gdImageDestroy(src);
31 gdImageDestroy(dst);
32 return gdNumFailures();
33 }
34