aboutsummaryrefslogtreecommitdiffstats
path: root/src/jpeg.c
diff options
context:
space:
mode:
authorJohn Hawthorn <jhawthor@uvic.ca>2008-05-19 20:04:22 -0700
committerJohn Hawthorn <jhawthor@uvic.ca>2008-05-19 20:04:22 -0700
commitbfbeab9e9a7446ed6b40c0ad557d631c0d738c6c (patch)
tree227e1d9caded47241edb21f55151eaebe262d923 /src/jpeg.c
parent02a0e01267d6c5be936b32360968199013e8096d (diff)
downloadmirror-meh-bfbeab9e9a7446ed6b40c0ad557d631c0d738c6c.tar.gz
mirror-meh-bfbeab9e9a7446ed6b40c0ad557d631c0d738c6c.tar.bz2
mirror-meh-bfbeab9e9a7446ed6b40c0ad557d631c0d738c6c.zip
prepare for other file types
Diffstat (limited to 'src/jpeg.c')
-rw-r--r--src/jpeg.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/jpeg.c b/src/jpeg.c
index cf6e4fd..f0ea699 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -19,11 +19,10 @@ static void error_exit(j_common_ptr cinfo){
exit(1);
}
-unsigned char *loadjpeg(char *filename, int *width, int *height){
+unsigned char *loadjpeg(FILE *infile, int *width, int *height){
struct jpeg_decompress_struct cinfo;
struct error_mgr jerr;
- FILE *infile;
JSAMPARRAY buffer;
int row_stride;
int i = 0;
@@ -31,11 +30,6 @@ unsigned char *loadjpeg(char *filename, int *width, int *height){
int y;
unsigned char *retbuf;
- if((infile = fopen(filename, "rb")) == NULL){
- fprintf(stderr, "can't open %s\n", filename);
- exit(1);
- }
-
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = error_exit;