From 3a97459145aa5f36e31c4f98dfb11353c2a1c337 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 7 Aug 2025 12:47:35 -0230 Subject: [PATCH] Updated tinyexif lib to latest release version. --- src/lib/tinyexif/source/TinyEXIF.cpp | 8 ++++---- src/lib/tinyexif/source/TinyEXIF.h | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib/tinyexif/source/TinyEXIF.cpp b/src/lib/tinyexif/source/TinyEXIF.cpp index cfdb4520c..d507e8460 100644 --- a/src/lib/tinyexif/source/TinyEXIF.cpp +++ b/src/lib/tinyexif/source/TinyEXIF.cpp @@ -33,8 +33,6 @@ #include "TinyEXIF.h" -#define TINYEXIF_NO_XMP_SUPPORT - #ifndef TINYEXIF_NO_XMP_SUPPORT #include #endif // TINYEXIF_NO_XMP_SUPPORT @@ -945,12 +943,14 @@ int EXIFInfo::parseFromEXIFSegment(const uint8_t* buf, unsigned len) { // 8 bytes if (offs + 8 > len) return PARSE_CORRUPT_DATA; + const uint32_t _ONE32 = 1; + const bool IS_LITTLE_ENDIAN = reinterpret_cast(&_ONE32)[0] == 1; bool alignIntel; if (buf[offs] == 'I' && buf[offs+1] == 'I') - alignIntel = true; // 1: Intel byte alignment + alignIntel = IS_LITTLE_ENDIAN; // 1: Intel byte alignment else if (buf[offs] == 'M' && buf[offs+1] == 'M') - alignIntel = false; // 0: Motorola byte alignment + alignIntel = !IS_LITTLE_ENDIAN; // 0: Motorola byte alignment else return PARSE_UNKNOWN_BYTEALIGN; EntryParser parser(buf, len, offs, alignIntel); diff --git a/src/lib/tinyexif/source/TinyEXIF.h b/src/lib/tinyexif/source/TinyEXIF.h index c63a79aeb..bf94bd074 100644 --- a/src/lib/tinyexif/source/TinyEXIF.h +++ b/src/lib/tinyexif/source/TinyEXIF.h @@ -34,15 +34,19 @@ #ifndef __TINYEXIF_H__ #define __TINYEXIF_H__ -#include // Added by SA (2023-05-05), needed for gcc-13 -#include +////////////////////////////////////////////// +// Added by SA (2023-05-05), needed for gcc-13 +#define TINYEXIF_NO_XMP_SUPPORT +#include +////////////////////////////////////////////// +#include #include #include #define TINYEXIF_MAJOR_VERSION 1 #define TINYEXIF_MINOR_VERSION 0 -#define TINYEXIF_PATCH_VERSION 1 +#define TINYEXIF_PATCH_VERSION 3 #ifdef _MSC_VER # ifdef TINYEXIF_EXPORT