summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c')
-rw-r--r--Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c b/Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c
new file mode 100644
index 00000000000..d9fd1aeaf3f
--- /dev/null
+++ b/Build/source/libs/gd/gd-2.0.35/tests/jpeg/jpeg_read.c
@@ -0,0 +1,36 @@
+/* $Id: jpeg_read.c,v 1.1.2.2 2007/04/10 20:32:37 pajoye Exp $ */
+#include "gd.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "gdtest.h"
+
+int main()
+{
+ int error;
+ gdImagePtr im;
+ FILE *fp;
+ char path[1024];
+
+ sprintf(path, "%s/jpeg/conv_test.jpeg", GDTEST_TOP_DIR);
+ fp = fopen(path, "rb");
+ if (!fp) {
+ printf("failed, cannot open file\n");
+ return 1;
+ }
+
+ im = gdImageCreateFromJpeg(fp);
+ fclose(fp);
+
+ sprintf(path, "%s/jpeg/conv_test_exp.png", GDTEST_TOP_DIR);
+ if (!gdAssertImageEqualsToFile(path, im)) {
+ error = 1;
+ } else {
+ if (im) {
+ gdImageDestroy(im);
+ error = 0;
+ } else {
+ error = 1;
+ }
+ }
+ return error;
+}