aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Hawthorn <jhawthor@uvic.ca>2008-05-19 21:07:27 -0700
committerJohn Hawthorn <jhawthor@uvic.ca>2008-05-19 21:07:27 -0700
commitc10594536108203e215e50bf3cf61c7e8aeb733f (patch)
tree1b84c7cf6a628745f0ed76a1dcb827530ef3d8de /src
parent1fde363229b261038dab179c91106d3d4e03cc32 (diff)
downloadmirror-meh-c10594536108203e215e50bf3cf61c7e8aeb733f.tar.gz
mirror-meh-c10594536108203e215e50bf3cf61c7e8aeb733f.tar.bz2
mirror-meh-c10594536108203e215e50bf3cf61c7e8aeb733f.zip
ready for gif decoder
Diffstat (limited to 'src')
-rw-r--r--src/gif.c9
-rw-r--r--src/gif.h5
-rw-r--r--src/jpeg.c1
-rw-r--r--src/main.c5
4 files changed, 16 insertions, 4 deletions
diff --git a/src/gif.c b/src/gif.c
new file mode 100644
index 0000000..0c1ebb3
--- /dev/null
+++ b/src/gif.c
@@ -0,0 +1,9 @@
+
+#include <stdio.h>
+
+#include "gif.h"
+
+unsigned char *loadgif(FILE *infile, int *bufwidth, int *bufheight){
+ return NULL;
+}
+
diff --git a/src/gif.h b/src/gif.h
new file mode 100644
index 0000000..17a86dc
--- /dev/null
+++ b/src/gif.h
@@ -0,0 +1,5 @@
+
+#include <stdio.h>
+
+unsigned char *loadgif(FILE *, int *, int *);
+
diff --git a/src/jpeg.c b/src/jpeg.c
index f0ea699..bf90f2d 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -66,7 +66,6 @@ unsigned char *loadjpeg(FILE *infile, int *width, int *height){
}
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
- fclose(infile);
return retbuf;
}
diff --git a/src/main.c b/src/main.c
index 75f106f..e9c0517 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,7 +10,7 @@
#include <sys/time.h>
#include "jpeg.h"
-#include "util.h"
+#include "gif.h"
Display *display;
int screen;
@@ -130,8 +130,7 @@ unsigned char *loadbuf(const char *filename, int *bufwidth, int *bufheight){
printf("IT'S A PNG!!!\n");
buf = NULL;
}else if(!memcmp("GIF", head, 3)){
- printf("IT'S A GIF!!!\n");
- buf = NULL;
+ buf = loadgif(f, bufwidth, bufheight);
}else{
fprintf(stderr, "Unknown file type: '%s'\n", filename);
buf = NULL;