diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-10-03 16:19:19 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2016-10-03 16:19:19 +0200 |
commit | 65d40f5aa5d2e5c74f2d7bca1fb8ecf60b16830c (patch) | |
tree | 793c7139d826b4969cfecbc91319445fad238c69 /tests/gdimagerotate | |
parent | ddf3b493f1921467e8f650ad4b861c33d1b658db (diff) | |
download | libgd-65d40f5aa5d2e5c74f2d7bca1fb8ecf60b16830c.tar.gz |
Fix #319: gdImageRotateInterpolated can have wrong background color
We backport the fix for <https://bugs.php.net/65070>, and also the fix for
<https://bugs.php.net/70976> which was introduced by fixing 65070.
Diffstat (limited to 'tests/gdimagerotate')
-rw-r--r-- | tests/gdimagerotate/.gitignore | 1 | ||||
-rw-r--r-- | tests/gdimagerotate/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/gdimagerotate/Makemodule.am | 5 | ||||
-rw-r--r-- | tests/gdimagerotate/php_bug_65070.c | 27 | ||||
-rw-r--r-- | tests/gdimagerotate/php_bug_65070.gif | bin | 0 -> 8424 bytes | |||
-rw-r--r-- | tests/gdimagerotate/php_bug_65070_exp.png | bin | 0 -> 32722 bytes |
6 files changed, 33 insertions, 1 deletions
diff --git a/tests/gdimagerotate/.gitignore b/tests/gdimagerotate/.gitignore index f6fac46..e6f0a79 100644 --- a/tests/gdimagerotate/.gitignore +++ b/tests/gdimagerotate/.gitignore @@ -1,2 +1,3 @@ /bug00067 /php_bug_64898 +/php_bug_65070 diff --git a/tests/gdimagerotate/CMakeLists.txt b/tests/gdimagerotate/CMakeLists.txt index 67005da..e5ea84a 100644 --- a/tests/gdimagerotate/CMakeLists.txt +++ b/tests/gdimagerotate/CMakeLists.txt @@ -1,6 +1,7 @@ LIST(APPEND TESTS_FILES bug00067 php_bug_64898 + php_bug_65070 ) ADD_GD_TESTS() diff --git a/tests/gdimagerotate/Makemodule.am b/tests/gdimagerotate/Makemodule.am index 696344b..99b2398 100644 --- a/tests/gdimagerotate/Makemodule.am +++ b/tests/gdimagerotate/Makemodule.am @@ -5,7 +5,8 @@ endif if HAVE_LIBPNG libgd_test_programs += \ - gdimagerotate/php_bug_64898 + gdimagerotate/php_bug_64898 \ + gdimagerotate/php_bug_65070 endif EXTRA_DIST += \ @@ -25,4 +26,6 @@ EXTRA_DIST += \ gdimagerotate/bug00067_180_exp.png \ gdimagerotate/php_bug_64898.png \ gdimagerotate/php_bug_64898_exp.png \ + gdimagerotate/php_bug_65070.gif \ + gdimagerotate/php_bug_65070_exp.png \ gdimagerotate/remirh128.png diff --git a/tests/gdimagerotate/php_bug_65070.c b/tests/gdimagerotate/php_bug_65070.c new file mode 100644 index 0000000..6a212da --- /dev/null +++ b/tests/gdimagerotate/php_bug_65070.c @@ -0,0 +1,27 @@ +#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+ gdImagePtr src, dst;
+ FILE *fp;
+ int black;
+ char *path;
+
+ fp = gdTestFileOpen2("gdimagerotate", "php_bug_65070.gif");
+ src = gdImageCreateFromGif(fp);
+ fclose(fp);
+
+ black = gdImageColorAllocateAlpha(src, 0, 0, 0, 0);
+ dst = gdImageRotateInterpolated(src, 30.0, black);
+
+ path = gdTestFilePath2("gdimagerotate", "php_bug_65070_exp.png");
+ gdAssertImageEqualsToFile(path, dst);
+ gdFree(path);
+
+ gdImageDestroy(src);
+ gdImageDestroy(dst);
+
+ return gdNumFailures();
+}
diff --git a/tests/gdimagerotate/php_bug_65070.gif b/tests/gdimagerotate/php_bug_65070.gif Binary files differnew file mode 100644 index 0000000..4c2fd1b --- /dev/null +++ b/tests/gdimagerotate/php_bug_65070.gif diff --git a/tests/gdimagerotate/php_bug_65070_exp.png b/tests/gdimagerotate/php_bug_65070_exp.png Binary files differnew file mode 100644 index 0000000..fba85f6 --- /dev/null +++ b/tests/gdimagerotate/php_bug_65070_exp.png |