mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 03:29:16 +02:00
Added support for thumbnail images in waypoint info
+ fixed and improved exif parser
This commit is contained in:
@ -4,10 +4,12 @@
|
||||
#define TIFF_MM 0x4D4D
|
||||
#define TIFF_MAGIC 42
|
||||
|
||||
TIFFFile::TIFFFile(QIODevice *device) : _device(device), _ifd(0)
|
||||
TIFFFile::TIFFFile(QIODevice *device) : _device(device), _ifd(0), _offset(0)
|
||||
{
|
||||
quint16 endian, magic;
|
||||
|
||||
_offset = _device->pos();
|
||||
|
||||
if (_device->read((char*)&endian, sizeof(endian)) < (qint64)sizeof(endian))
|
||||
return;
|
||||
if (endian == TIFF_II)
|
||||
|
@ -19,8 +19,10 @@ public:
|
||||
bool isValid() const {return _ifd != 0;}
|
||||
quint32 ifd() const {return _ifd;}
|
||||
|
||||
bool seek(qint64 pos) {return _device->seek(pos);}
|
||||
qint64 pos() const {return _device->pos();}
|
||||
bool seek(qint64 pos) {return _device->seek(_offset + pos);}
|
||||
qint64 pos() const {return _offset + _device->pos();}
|
||||
QByteArray read(qint64 maxSize) {return _device->read(maxSize);}
|
||||
|
||||
template<class T> bool readValue(T &val)
|
||||
{
|
||||
T data;
|
||||
@ -50,6 +52,7 @@ private:
|
||||
QIODevice *_device;
|
||||
bool _be;
|
||||
quint32 _ifd;
|
||||
qint64 _offset;
|
||||
};
|
||||
|
||||
#endif // TIFFFILE_H
|
||||
|
Reference in New Issue
Block a user