From bac55e317b81fdd81be11acd1a2b17d41f85b5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 9 Dec 2023 18:00:24 +0100 Subject: [PATCH] Added workaround for broken Qt SVG image plugin colliding with the MVT plugin --- src/map/mbtilesmap.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/map/mbtilesmap.cpp b/src/map/mbtilesmap.cpp index 19af3fc0..7ac6791a 100644 --- a/src/map/mbtilesmap.cpp +++ b/src/map/mbtilesmap.cpp @@ -135,7 +135,9 @@ bool MBTilesMap::getTileSize() QByteArray data = query.value(0).toByteArray(); QBuffer buffer(&data); - QImageReader reader(&buffer); + /* Explicitly specify the image plugin in case of vector tiles + (QTBUG-119910 workaround) */ + QImageReader reader(&buffer, _scalable ? QByteArray("mvt") : QByteArray()); QSize tileSize(reader.size()); if (!tileSize.isValid() || tileSize.width() != tileSize.height()) { @@ -215,9 +217,9 @@ MBTilesMap::MBTilesMap(const QString &fileName, QObject *parent) return; if (!getBounds()) return; + getTileFormat(); if (!getTileSize()) return; - getTileFormat(); getTilePixelRatio(); getName();