diff --git a/src/plugins/marketplace/productlistmodel.cpp b/src/plugins/marketplace/productlistmodel.cpp index 0e240cc243e..13aabe176b8 100644 --- a/src/plugins/marketplace/productlistmodel.cpp +++ b/src/plugins/marketplace/productlistmodel.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -380,7 +381,8 @@ void SectionedProducts::onImageDownloadFinished(QNetworkReply *reply) if (reply->error() == QNetworkReply::NoError) { const QByteArray data = reply->readAll(); QPixmap pixmap; - if (pixmap.loadFromData(data)) { + const QString imageFormat = QFileInfo(reply->request().url().fileName()).suffix(); + if (pixmap.loadFromData(data, imageFormat.toLatin1())) { const QString url = reply->request().url().toString(); QPixmapCache::insert(url, pixmap.scaled(ProductListModel::defaultImageSize, Qt::KeepAspectRatio, Qt::SmoothTransformation)); diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 9c895db6269..a983752838e 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -513,7 +513,7 @@ QPixmap ExamplesListModel::fetchPixmapAndUpdatePixmapCache(const QString &url) c if (!fetchedData.isEmpty()) { QBuffer imgBuffer(&fetchedData); imgBuffer.open(QIODevice::ReadOnly); - QImageReader reader(&imgBuffer); + QImageReader reader(&imgBuffer, QFileInfo(url).suffix().toLatin1()); QImage img = reader.read(); img = ScreenshotCropper::croppedImage(img, url, ListModel::defaultImageSize); pixmap = QPixmap::fromImage(img);