1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-18 19:52:09 +01:00

Fixed lat/lon reference parsing in big endian EXIF entries

Closes #218
This commit is contained in:
Martin Tůma 2019-08-11 09:26:54 +02:00
parent b72a9e67fe
commit 680104fec3
2 changed files with 6 additions and 2 deletions

View File

@ -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);}

View File

@ -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;