From f44b14473d33c2533ce16714cdfcf71ecba8b231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 9 Jan 2018 01:29:20 +0100 Subject: [PATCH] Fixed broken MM files size issue --- src/map/geotiff.cpp | 18 ------------------ src/map/geotiff.h | 5 ----- src/map/offlinemap.cpp | 9 ++++----- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/map/geotiff.cpp b/src/map/geotiff.cpp index a8ba874c..edcd6963 100644 --- a/src/map/geotiff.cpp +++ b/src/map/geotiff.cpp @@ -74,17 +74,6 @@ bool GeoTIFF::readEntry(TIFFFile &file, Ctx &ctx) return false; switch (tag) { - case ImageWidth: - if (!(type == TIFF_SHORT || type == TIFF_LONG)) - return false; - _size.setWidth(offset); - break; - case ImageHeight: - if (!(type == TIFF_SHORT || type == TIFF_LONG)) - return false; - _size.setHeight(offset); - break; - case ModelPixelScaleTag: if (type != TIFF_DOUBLE || count != 3) return false; @@ -397,10 +386,6 @@ bool GeoTIFF::load(const QString &path) } } - if (!_size.isValid()) { - _errorString = "Invalid/missing image size"; - return false; - } if (!ctx.keys) { _errorString = "Not a GeoTIFF file"; return false; @@ -459,8 +444,5 @@ bool GeoTIFF::load(const QString &path) return false; } - QFileInfo fi(path); - _name = fi.fileName(); - return true; } diff --git a/src/map/geotiff.h b/src/map/geotiff.h index fa083f84..ec3b187c 100644 --- a/src/map/geotiff.h +++ b/src/map/geotiff.h @@ -20,9 +20,6 @@ public: Projection *projection() const {return _projection;} const QTransform &transform() const {return _transform;} - const QString name() const {return _name;} - const QSize &size() const {return _size;} - const QString &errorString() const {return _errorString;} private: @@ -60,8 +57,6 @@ private: QTransform _transform; Datum _datum; Projection *_projection; - QSize _size; - QString _name; QString _errorString; }; diff --git a/src/map/offlinemap.cpp b/src/map/offlinemap.cpp index b0a4ec8f..1aafeaec 100644 --- a/src/map/offlinemap.cpp +++ b/src/map/offlinemap.cpp @@ -162,8 +162,7 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) _errorString = gt.errorString(); return; } else { - _name = gt.name(); - _size = gt.size(); + _name = fi.fileName(); _imgPath = fileName; _datum = gt.datum(); _projection = gt.projection(); @@ -174,9 +173,6 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) return; } - _inverted = _transform.inverted(); - computeResolution(); - if (_tar.isOpen()) { if (!totalSizeSet()) return; @@ -197,6 +193,9 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) } } + _inverted = _transform.inverted(); + computeResolution(); + _valid = true; }