From bfbeab9e9a7446ed6b40c0ad557d631c0d738c6c Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 19 May 2008 20:04:22 -0700 Subject: prepare for other file types --- src/jpeg.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/jpeg.c') 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; -- cgit v1.2.3