ref: bd67e0f2b777bab967543f257a9bc2e1bf059b4c
parent: 67273ef32d5d5a0f8a0fc038948b8348c4387b5c
author: Mark Harris <mark.hsj@gmail.com>
date: Fri Dec 29 05:36:27 EST 2017
Relax JPEG check to allow EXIF metadata
--- a/src/info.c
+++ b/src/info.c
@@ -454,8 +454,7 @@
}
static int op_is_jpeg(const unsigned char *_buf,size_t _buf_sz){
- return _buf_sz>=11&&memcmp(_buf,"\xFF\xD8\xFF\xE0",4)==0
- &&(_buf[4]<<8|_buf[5])>=16&&memcmp(_buf+6,"JFIF",5)==0;
+ return _buf_sz>=3&&memcmp(_buf,"\xFF\xD8\xFF",3)==0;
}
/*Tries to extract the width, height, bits per pixel, and palette size of a