diff options
-rw-r--r-- | src/lib/jpeg.c | 12 | ||||
-rw-r--r-- | src/lib/jpeg.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/jpeg.c b/src/lib/jpeg.c index a86ea06661..8d370ec67b 100644 --- a/src/lib/jpeg.c +++ b/src/lib/jpeg.c @@ -257,6 +257,18 @@ static int dec_checkmarker(void) return 0; } +void jpeg_fetch_size(unsigned char *buf, int *width, int *height) +{ + datap = buf; + getbyte(); + getbyte(); + readtables(M_SOF0); + getword(); + getbyte(); + *height = getword(); + *width = getword(); +} + int jpeg_check_size(unsigned char *buf, int width, int height) { datap = buf; diff --git a/src/lib/jpeg.h b/src/lib/jpeg.h index a32e4aff8e..bdde8a4ecf 100644 --- a/src/lib/jpeg.h +++ b/src/lib/jpeg.h @@ -49,6 +49,7 @@ struct jpeg_decdata { }; int jpeg_decode(unsigned char *, unsigned char *, int, int, int, struct jpeg_decdata *); +void jpeg_fetch_size(unsigned char *buf, int *width, int *height); int jpeg_check_size(unsigned char *, int, int); #endif |