diff --git a/src/common/tifffile.h b/src/common/tifffile.h index 05dd816d..9ec461b0 100644 --- a/src/common/tifffile.h +++ b/src/common/tifffile.h @@ -17,6 +17,7 @@ public: TIFFFile(QIODevice *device); bool isValid() const {return _ifd != 0;} + bool isBE() const {return _be;} quint32 ifd() const {return _ifd;} bool seek(qint64 pos) {return _device->seek(_offset + pos);} diff --git a/src/data/exifparser.cpp b/src/data/exifparser.cpp index 0314517c..80200efc 100644 --- a/src/data/exifparser.cpp +++ b/src/data/exifparser.cpp @@ -113,9 +113,12 @@ Coordinates EXIFParser::coordinates(TIFFFile &file, const IFDEntry &lon, if (!c.isValid()) return Coordinates(); - if (lonRef.offset == 'W') + char ew = file.isBE() ? lonRef.offset >> 24 : lonRef.offset; + char ns = file.isBE() ? latRef.offset >> 24 : latRef.offset; + + if (ew == 'W') c.rlon() = -c.lon(); - if (latRef.offset == 'S') + if (ns == 'S') c.rlat() = -c.lat(); return c;