diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2023-01-25 19:49:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 19:49:31 +0100 |
commit | d11db230d3e8c48630e0abe24e34f0f12f45d989 (patch) | |
tree | 539422e4d626d011420e0cfe775d2049866533b9 | |
parent | fe3e0d388c5b964d8ac2612e31b28344d400b063 (diff) | |
parent | 39abd7238cea2ba8baa4bcac1d6fc01c6cb8afab (diff) | |
download | libgd-master.tar.gz |
Fix #847: enable back GD_BICUBIC* interpolation methods
-rw-r--r-- | src/gd_interpolation.c | 5 | ||||
-rw-r--r-- | tests/gdimagesetinterpolationmethod/.gitignore | 1 | ||||
-rw-r--r-- | tests/gdimagesetinterpolationmethod/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/gdimagesetinterpolationmethod/Makemodule.am | 3 | ||||
-rw-r--r-- | tests/gdimagesetinterpolationmethod/github_bug_00847.c | 12 |
5 files changed, 21 insertions, 1 deletions
diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c index 1f625dd..cf77da7 100644 --- a/src/gd_interpolation.c +++ b/src/gd_interpolation.c @@ -2257,6 +2257,11 @@ BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMet case GD_BESSEL: im->interpolation = filter_bessel; break; + case GD_BICUBIC_FIXED: + case GD_BICUBIC: + /* no interpolation as gdImageScale calls a dedicated function */ + im->interpolation = NULL; + break; case GD_BLACKMAN: im->interpolation = filter_blackman; break; diff --git a/tests/gdimagesetinterpolationmethod/.gitignore b/tests/gdimagesetinterpolationmethod/.gitignore index db7b3af..4bf2924 100644 --- a/tests/gdimagesetinterpolationmethod/.gitignore +++ b/tests/gdimagesetinterpolationmethod/.gitignore @@ -1 +1,2 @@ /github_bug_00584 +/github_bug_00847 diff --git a/tests/gdimagesetinterpolationmethod/CMakeLists.txt b/tests/gdimagesetinterpolationmethod/CMakeLists.txt index 6551062..bbed558 100644 --- a/tests/gdimagesetinterpolationmethod/CMakeLists.txt +++ b/tests/gdimagesetinterpolationmethod/CMakeLists.txt @@ -1,5 +1,6 @@ LIST(APPEND TESTS_FILES github_bug_00584 + github_bug_00847 ) ADD_GD_TESTS() diff --git a/tests/gdimagesetinterpolationmethod/Makemodule.am b/tests/gdimagesetinterpolationmethod/Makemodule.am index 1b83336..77d928d 100644 --- a/tests/gdimagesetinterpolationmethod/Makemodule.am +++ b/tests/gdimagesetinterpolationmethod/Makemodule.am @@ -1,5 +1,6 @@ libgd_test_programs += \ - gdimagesetinterpolationmethod/github_bug_00584 + gdimagesetinterpolationmethod/github_bug_00584 \ + gdimagesetinterpolationmethod/github_bug_00847 EXTRA_DIST += \ gdimagesetinterpolationmethod/CMakeLists.txt diff --git a/tests/gdimagesetinterpolationmethod/github_bug_00847.c b/tests/gdimagesetinterpolationmethod/github_bug_00847.c new file mode 100644 index 0000000..bd85216 --- /dev/null +++ b/tests/gdimagesetinterpolationmethod/github_bug_00847.c @@ -0,0 +1,12 @@ +#include "gd.h" +#include "gdtest.h" + +int main() +{ + gdImagePtr im; + im = gdImageCreate(1, 1); + gdTestAssert(gdImageSetInterpolationMethod(im, GD_BICUBIC_FIXED) != 0); + gdTestAssert(gdImageGetInterpolationMethod(im) == GD_BICUBIC_FIXED); + gdImageDestroy(im); + return gdNumFailures(); +} |