kimgio: add one more jpg header variantion

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-09-20 02:11:39 +03:00
parent 87c866c585
commit 056fad2d3c

View file

@ -30,6 +30,10 @@
#include <Magick++/STL.h> #include <Magick++/STL.h>
static const char* const s_magickpluginformat = "magick"; static const char* const s_magickpluginformat = "magick";
static const ushort s_peekbuffsize = 32;
// for reference:
// https://en.wikipedia.org/wiki/List_of_file_signatures
static const uchar s_eps30header[] = { 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x2D, 0x33, 0x2E, 0x30, 0x20, 0x45, 0x50, 0x53, 0x46, 0x2D, 0x33, 0x2E, 0x30 }; static const uchar s_eps30header[] = { 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x2D, 0x33, 0x2E, 0x30, 0x20, 0x45, 0x50, 0x53, 0x46, 0x2D, 0x33, 0x2E, 0x30 };
static const uchar s_eps31header[] = { 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x2D, 0x33, 0x2E, 0x31, 0x20, 0x45, 0x50, 0x53, 0x46, 0x2D, 0x33, 0x2E, 0x30 }; static const uchar s_eps31header[] = { 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x2D, 0x33, 0x2E, 0x31, 0x20, 0x45, 0x50, 0x53, 0x46, 0x2D, 0x33, 0x2E, 0x30 };
static const uchar s_jp2header[] = { 0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A }; static const uchar s_jp2header[] = { 0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A };
@ -39,15 +43,13 @@ static const uchar s_gif87aheader[] = { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 };
static const uchar s_gif89aheader[] = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }; static const uchar s_gif89aheader[] = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 };
static const uchar s_icoheader[] = { 0x0, 0x0, 0x1, 0x0, 0x0 }; static const uchar s_icoheader[] = { 0x0, 0x0, 0x1, 0x0, 0x0 };
static const uchar s_jpgheader[] = { 0xFF, 0xD8, 0xFF, 0xE0 }; static const uchar s_jpgheader[] = { 0xFF, 0xD8, 0xFF, 0xE0 };
static const uchar s_jpg2header[] = { 0xFF, 0xD8, 0xFF, 0xEE };
static const uchar s_exrheader[] = { 0x76, 0x2F, 0x31, 0x01 }; static const uchar s_exrheader[] = { 0x76, 0x2F, 0x31, 0x01 };
static const uchar s_psdheader[] = { 0x38, 0x42, 0x50, 0x53 }; static const uchar s_psdheader[] = { 0x38, 0x42, 0x50, 0x53 };
static const uchar s_tifleheader[] = { 0x49, 0x49, 0x2A, 0x00 }; static const uchar s_tifleheader[] = { 0x49, 0x49, 0x2A, 0x00 };
static const uchar s_tifbeheader[] = { 0x4D, 0x4D, 0x00, 0x2A }; static const uchar s_tifbeheader[] = { 0x4D, 0x4D, 0x00, 0x2A };
static const uchar s_bmpheader[] = { 0x42, 0x4D }; static const uchar s_bmpheader[] = { 0x42, 0x4D };
static const ushort s_peekbuffsize = 32;
// for reference:
// https://en.wikipedia.org/wiki/List_of_file_signatures
static const struct HeadersTblData { static const struct HeadersTblData {
const uchar *header; const uchar *header;
const int headersize; const int headersize;
@ -62,6 +64,7 @@ static const struct HeadersTblData {
{ s_gif89aheader, 6, "gif", }, { s_gif89aheader, 6, "gif", },
{ s_icoheader, 5, "ico", }, { s_icoheader, 5, "ico", },
{ s_jpgheader, 4, "jpg", }, { s_jpgheader, 4, "jpg", },
{ s_jpg2header, 4, "jpg", },
{ s_exrheader, 4, "exr", }, { s_exrheader, 4, "exr", },
{ s_psdheader, 4, "psd", }, { s_psdheader, 4, "psd", },
{ s_tifleheader, 4, "tif", }, { s_tifleheader, 4, "tif", },