Commit 08a18cbc authored by Boudewijn Rempt's avatar Boudewijn Rempt

Use our own tiff loader for the recent files thumbnails

BUG:408731
parent 23a51334
......@@ -22,6 +22,8 @@
#include <QDesktopServices>
#include <QFileInfo>
#include <QMimeData>
#include <QPixmap>
#include <QImage>
#include "kis_action_manager.h"
#include "kactioncollection.h"
......@@ -36,6 +38,10 @@
#include "krita_utils.h"
#include "KoStore.h"
#include "kis_config.h"
#include "KisDocument.h"
#include <kis_image.h>
#include <kis_paint_device.h>
#include <KisPart.h>
KisWelcomePageWidget::KisWelcomePageWidget(QWidget *parent)
: QWidget(parent)
......@@ -236,6 +242,16 @@ void KisWelcomePageWidget::populateRecentDocuments()
}
}
}
else if (recentFileUrlPath.toLower().endsWith("tif")) {
// Workaround for a bug in Qt tiff QImageIO plugin
QScopedPointer<KisDocument> doc;
doc.reset(KisPart::instance()->createDocument());
bool r = doc->openUrl(QUrl::fromLocalFile(recentFileUrlPath), KisDocument::DontAddToRecent);
if (r) {
KisPaintDeviceSP projection = doc->image()->projection();
recentItem->setIcon(QIcon(QPixmap::fromImage(projection->createThumbnail(48, 48, projection->exactBounds()))));
}
}
else {
QImage img;
img.setDevicePixelRatio(devicePixelRatioF());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment