diff --git a/src/common/tifffile.h b/src/common/tifffile.h index 9ec461b0..c2634ea3 100644 --- a/src/common/tifffile.h +++ b/src/common/tifffile.h @@ -9,6 +9,7 @@ #define TIFF_SHORT 3 #define TIFF_LONG 4 #define TIFF_RATIONAL 5 +#define TIFF_SRATIONAL 10 #define TIFF_DOUBLE 12 class TIFFFile diff --git a/src/data/exifparser.cpp b/src/data/exifparser.cpp index 5bb85eb6..9c257ff4 100644 --- a/src/data/exifparser.cpp +++ b/src/data/exifparser.cpp @@ -82,7 +82,10 @@ double EXIFParser::altitude(TIFFFile &file, const IFDEntry &alt, double EXIFParser::coordinate(TIFFFile &file, const IFDEntry &ll) const { - if (!(ll.type == TIFF_RATIONAL && ll.count == 3)) + // Some broken image creators like NOKIA phones use a wrong (SRATIONAL) + // data type + if (!((ll.type == TIFF_RATIONAL || ll.type == TIFF_SRATIONAL) + && ll.count == 3)) return NAN; if (!file.seek(ll.offset))