Commit dd81431d authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't generate a full-scale linear QImage when generating preview for .kra

CCBUG:352781
parent ae295c06
......@@ -999,12 +999,11 @@ QPixmap KisDocument::generatePreview(const QSize& size)
newSize.scale(size, Qt::KeepAspectRatio);
QImage image;
if (bounds.width() < 10000 && bounds.height() < 10000) {
image = d->image->convertToQImage(d->image->bounds(), 0);
}
else {
image = d->image->convertToQImage(QRect(0, 0, newSize.width(), newSize.height()), newSize, 0);
}
QRect generationRect =
bounds.width() < 1024 && bounds.height() < 1024 ?
bounds : QRect(0,0,1024,1024);
image = d->image->convertToQImage(generationRect, 0);
image = image.scaled(newSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
return QPixmap::fromImage(image);
}
......
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