Code cleanup
[GPXSee.git] / src / map / tifffile.cpp
blob232295ae6fc69b57b8222bd50c10b91501d99d53
1 #include "tifffile.h"
3 #define TIFF_II 0x4949
4 #define TIFF_MM 0x4D4D
5 #define TIFF_MAGIC 42
7 bool TIFFFile::readHeader(quint32 &ifd)
9 quint16 endian, magic;
11 if (QFile::read((char*)&endian, sizeof(endian)) < (qint64)sizeof(endian))
12 return false;
13 if (endian == TIFF_II)
14 _be = false;
15 else if (endian == TIFF_MM)
16 _be = true;
17 else
18 return false;
20 if (!readValue(magic))
21 return false;
22 if (magic != TIFF_MAGIC)
23 return false;
24 if (!readValue(ifd))
25 return false;
27 return true;