From 056fad2d3c953453b539dbc1a4cf8bae4eda53c9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 20 Sep 2022 02:11:39 +0300 Subject: [PATCH] kimgio: add one more jpg header variantion Signed-off-by: Ivailo Monev --- kimgio/magick.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kimgio/magick.cpp b/kimgio/magick.cpp index b5fb6e11..8b043705 100644 --- a/kimgio/magick.cpp +++ b/kimgio/magick.cpp @@ -30,6 +30,10 @@ #include 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_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 }; @@ -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_icoheader[] = { 0x0, 0x0, 0x1, 0x0, 0x0 }; 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_psdheader[] = { 0x38, 0x42, 0x50, 0x53 }; static const uchar s_tifleheader[] = { 0x49, 0x49, 0x2A, 0x00 }; static const uchar s_tifbeheader[] = { 0x4D, 0x4D, 0x00, 0x2A }; 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 { const uchar *header; const int headersize; @@ -62,6 +64,7 @@ static const struct HeadersTblData { { s_gif89aheader, 6, "gif", }, { s_icoheader, 5, "ico", }, { s_jpgheader, 4, "jpg", }, + { s_jpg2header, 4, "jpg", }, { s_exrheader, 4, "exr", }, { s_psdheader, 4, "psd", }, { s_tifleheader, 4, "tif", },