1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 09:05:14 +01:00

Fixed the change that has broken non-TAR maps

Do not fail on the first image read error - there may be files with a "_%u_%u."
file name match that are not image tiles.
This commit is contained in:
Martin Tůma 2024-01-01 10:48:16 +01:00
parent 789606cf86
commit d994fae4ce

View File

@ -272,7 +272,7 @@ bool OziMap::setTileInfo(const QStringList &tiles, const QString &path)
for (int i = 0; i < tiles.size(); i++) { for (int i = 0; i < tiles.size(); i++) {
const QString &tile = tiles.at(i); const QString &tile = tiles.at(i);
if (tile.startsWith("set/") && tile.contains(rx)) { if (tile.contains(rx)) {
_tile.path = QString(tile).replace(rx, "_%1_%2."); _tile.path = QString(tile).replace(rx, "_%1_%2.");
if (_tar) { if (_tar) {
@ -284,9 +284,8 @@ bool OziMap::setTileInfo(const QStringList &tiles, const QString &path)
_tile.size = QImageReader(path + "/" + tile).size(); _tile.size = QImageReader(path + "/" + tile).size();
} }
if (!_tile.size.isValid()) { if (!_tile.size.isValid()) {
_errorString = QString("Error retrieving tile size: " qWarning("%s: error reading tile image", qPrintable(tile));
"%1: Invalid image").arg(QFileInfo(tile).fileName()); continue;
return false;
} }
_map.path = QString(); _map.path = QString();