summaryrefslogtreecommitdiff
path: root/tests/gdimagecopy
diff options
context:
space:
mode:
authorpajoye <none@none>2007-11-20 13:43:35 +0000
committerpajoye <none@none>2007-11-20 13:43:35 +0000
commitdaac285cd6d8560d8afb4aa8877b71d8d99bd728 (patch)
tree46e479a06cb03e2ce129a6eab2b2114388b506a5 /tests/gdimagecopy
parent191ef868323d10b2e44b053b11005b7a41519424 (diff)
downloadlibgd-daac285cd6d8560d8afb4aa8877b71d8d99bd728.tar.gz
- #81, MFB, gdImageCopy ignores the transparent color
Diffstat (limited to 'tests/gdimagecopy')
-rw-r--r--tests/gdimagecopy/bug00081.c35
-rw-r--r--tests/gdimagecopy/bug00081_exp.pngbin0 -> 95 bytes
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/gdimagecopy/bug00081.c b/tests/gdimagecopy/bug00081.c
new file mode 100644
index 0000000..6c5e0fa
--- /dev/null
+++ b/tests/gdimagecopy/bug00081.c
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+#include "gd.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im, im2;
+ int error = 0;
+ FILE *fp;
+ char path[2048];
+ const char *file_exp = "bug00081_exp.png";
+
+ im = gdImageCreateTrueColor(5, 5);
+
+ gdImageFilledRectangle(im, 0, 0, 49, 49, 0x00FFFFFF);
+ gdImageColorTransparent(im, 0xFFFFFF);
+ gdImageFilledRectangle(im, 1, 1, 4, 4, 0xFF00FF);
+
+ im2 = gdImageCreateTrueColor(20, 20);
+
+ gdImageCopy(im2, im, 2, 2 , 0, 0, gdImageSX(im), gdImageSY(im));
+
+ sprintf(path, "%s/gdimagecopy/%s", GDTEST_TOP_DIR, file_exp);
+ if (!gdAssertImageEqualsToFile(path, im2)) {
+ error = 1;
+ printf("Reference image and destination differ\n");
+ }
+
+ gdImageDestroy(im);
+ gdImageDestroy(im2);
+ return error;
+}
diff --git a/tests/gdimagecopy/bug00081_exp.png b/tests/gdimagecopy/bug00081_exp.png
new file mode 100644
index 0000000..c5587f7
--- /dev/null
+++ b/tests/gdimagecopy/bug00081_exp.png
Binary files differ