mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 13:41:16 +01:00
29 lines
501 B
C++
29 lines
501 B
C++
|
#include "tifffile.h"
|
||
|
|
||
|
#define TIFF_II 0x4949
|
||
|
#define TIFF_MM 0x4D4D
|
||
|
#define TIFF_MAGIC 42
|
||
|
|
||
|
bool TIFFFile::readHeader(quint32 &ifd)
|
||
|
{
|
||
|
quint16 endian, magic;
|
||
|
|
||
|
if (QFile::read((char*)&endian, sizeof(endian)) < (qint64)sizeof(endian))
|
||
|
return false;
|
||
|
if (endian == TIFF_II)
|
||
|
_be = false;
|
||
|
else if (endian == TIFF_MM)
|
||
|
_be = true;
|
||
|
else
|
||
|
return false;
|
||
|
|
||
|
if (!readValue(magic))
|
||
|
return false;
|
||
|
if (magic != TIFF_MAGIC)
|
||
|
return false;
|
||
|
if (!readValue(ifd))
|
||
|
return false;
|
||
|
|
||
|
return true;
|
||
|
}
|