Revert "Fix #328: gdImageScale() with GD_WEIGHTED4 always returns NULL"
This reverts commit 0809c9f644
.
master
parent
0809c9f644
commit
0c0cd18aff
|
@ -2168,6 +2168,7 @@ BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMet
|
|||
|
||||
switch (id) {
|
||||
case GD_NEAREST_NEIGHBOUR:
|
||||
case GD_WEIGHTED4:
|
||||
im->interpolation = NULL;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
/bug00328
|
||||
/github_bug_00218
|
||||
/bug_overflow_large_new_size
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
LIST(APPEND TESTS_FILES
|
||||
bug00328
|
||||
github_bug_00218
|
||||
bug_overflow_large_new_size
|
||||
)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
libgd_test_programs += \
|
||||
gdimagescale/bug00328 \
|
||||
gdimagescale/github_bug_00218 \
|
||||
gdimagescale/bug_overflow_large_new_size
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* Regression test for <https://github.com/libgd/libgd/issues/328>
|
||||
*
|
||||
* We're testing that a simple scale operation with GD_WEIGHTED4 succeeds.
|
||||
*/
|
||||
|
||||
|
||||
#include "gd.h"
|
||||
#include "gdtest.h"
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
gdImagePtr src, dst;
|
||||
|
||||
src = gdImageCreateTrueColor(100, 100);
|
||||
gdImageFilledRectangle(src, 0,0, 99,99, gdTrueColorAlpha(255, 255, 255, gdAlphaOpaque));
|
||||
|
||||
gdImageSetInterpolationMethod(src, GD_WEIGHTED4);
|
||||
dst = gdImageScale(src, 200, 200);
|
||||
gdTestAssertMsg(dst != NULL, "scaling failed");
|
||||
|
||||
gdImageDestroy(src);
|
||||
gdImageDestroy(dst);
|
||||
|
||||
return gdNumFailures();
|
||||
}
|
Loading…
Reference in New Issue