1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +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;
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;
}

View File

@ -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;
};

View File

@ -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;
}