From: Matthias Kramm Date: Tue, 27 Apr 2010 23:17:35 +0000 (-0700) Subject: bugfixes in jpeg.c X-Git-Tag: version-0-9-1~40 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=a4be97bc967c8aceac1c893cbbe307b23b603683;hp=02885fc850a390f4e7407140fdcb042a109c6582 bugfixes in jpeg.c --- diff --git a/lib/jpeg.c b/lib/jpeg.c index 1f74910..1c5e91c 100644 --- a/lib/jpeg.c +++ b/lib/jpeg.c @@ -413,6 +413,8 @@ void jpeg_get_size(const char *filename, int *width, int *height) *width = 0; *height = 0; cinfo.err = jpeg_std_error(&jerr); + cinfo.image_width = 0; + cinfo.image_height = 0; jpeg_create_decompress(&cinfo); if ((fi = fopen(filename, "rb")) == NULL) { fprintf(stderr, "couldn't open %s\n", filename); diff --git a/lib/jpeg.h b/lib/jpeg.h index 090d147..ef4f4d2 100644 --- a/lib/jpeg.h +++ b/lib/jpeg.h @@ -13,6 +13,7 @@ int jpeg_save_to_file(unsigned char*data, int width, int height, int quality, FI int jpeg_save_to_mem(unsigned char*data, int width, int height, int quality, unsigned char*dest, int destsize); int jpeg_load(const char*filename, unsigned char**dest, int*width, int*height); int jpeg_load_from_mem(unsigned char*_data, int size, unsigned char*dest, int width, int height); +void jpeg_get_size(const char *fname, int *width, int *height); #ifdef __cplusplus }