OSDN Git Service

save and restore the device position in QSvgIOHandler::option()
authorIvailo Monev <xakepa10@gmail.com>
Wed, 5 Jul 2023 00:31:52 +0000 (03:31 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 5 Jul 2023 00:31:52 +0000 (03:31 +0300)
that will shush gwenview

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/plugins/imageformats/svg/qsvgiohandler.cpp

index d576e54..b7cfd45 100644 (file)
@@ -81,9 +81,12 @@ QVariant QSvgIOHandler::option(QImageIOHandler::ImageOption option) const
 {
     switch (option) {
         case QImageIOHandler::Size: {
+            const qint64 devicepos = device()->pos();
             if (!loadDevice()) {
+                device()->seek(devicepos);
                 return QVariant();
             }
+            device()->seek(devicepos);
             return m_defaultSize;
         }
         case QImageIOHandler::ScaledSize: {