1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-02 23:49:09 +01:00

Fixed broken MM files size issue

This commit is contained in:
Martin Tůma 2018-01-09 01:29:20 +01:00
parent 699de8b133
commit f44b14473d
3 changed files with 4 additions and 28 deletions

View File

@ -74,17 +74,6 @@ bool GeoTIFF::readEntry(TIFFFile &file, Ctx &ctx)
return false; return false;
switch (tag) { 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: case ModelPixelScaleTag:
if (type != TIFF_DOUBLE || count != 3) if (type != TIFF_DOUBLE || count != 3)
return false; 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) { if (!ctx.keys) {
_errorString = "Not a GeoTIFF file"; _errorString = "Not a GeoTIFF file";
return false; return false;
@ -459,8 +444,5 @@ bool GeoTIFF::load(const QString &path)
return false; return false;
} }
QFileInfo fi(path);
_name = fi.fileName();
return true; return true;
} }

View File

@ -20,9 +20,6 @@ public:
Projection *projection() const {return _projection;} Projection *projection() const {return _projection;}
const QTransform &transform() const {return _transform;} const QTransform &transform() const {return _transform;}
const QString name() const {return _name;}
const QSize &size() const {return _size;}
const QString &errorString() const {return _errorString;} const QString &errorString() const {return _errorString;}
private: private:
@ -60,8 +57,6 @@ private:
QTransform _transform; QTransform _transform;
Datum _datum; Datum _datum;
Projection *_projection; Projection *_projection;
QSize _size;
QString _name;
QString _errorString; QString _errorString;
}; };

View File

@ -162,8 +162,7 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent)
_errorString = gt.errorString(); _errorString = gt.errorString();
return; return;
} else { } else {
_name = gt.name(); _name = fi.fileName();
_size = gt.size();
_imgPath = fileName; _imgPath = fileName;
_datum = gt.datum(); _datum = gt.datum();
_projection = gt.projection(); _projection = gt.projection();
@ -174,9 +173,6 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent)
return; return;
} }
_inverted = _transform.inverted();
computeResolution();
if (_tar.isOpen()) { if (_tar.isOpen()) {
if (!totalSizeSet()) if (!totalSizeSet())
return; return;
@ -197,6 +193,9 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent)
} }
} }
_inverted = _transform.inverted();
computeResolution();
_valid = true; _valid = true;
} }