Commit 3f5a95c7 authored by Halla Rempt's avatar Halla Rempt
Browse files

Smoothscale the thumbnail for .kra files

BUG:328767
parent a8c4be41
......@@ -439,10 +439,18 @@ void KisDoc2::paintContent(QPainter& painter, const QRect& rc)
QPixmap KisDoc2::generatePreview(const QSize& size)
{
if (m_d->image) {
QSize newSize = m_d->image->bounds().size();
QRect bounds = m_d->image->bounds();
QSize newSize = bounds.size();
newSize.scale(size, Qt::KeepAspectRatio);
QImage image = m_d->image->convertToQImage(QRect(0, 0, newSize.width(), newSize.height()), newSize, 0);
QImage image;
if (bounds.width() < 10000 && bounds.height() < 10000) {
image = m_d->image->convertToQImage(m_d->image->bounds(), 0);
}
else {
image = m_d->image->convertToQImage(QRect(0, 0, newSize.width(), newSize.height()), newSize, 0);
}
image = image.scaled(newSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
return QPixmap::fromImage(image);
}
return QPixmap(size);
......
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