Commit bfe2539a authored by Randy Kron's avatar Randy Kron Committed by David Edmundson

Improve quality of images in notifications (Bug 385097)

Summary:
BUG: 385097
FIXED-IN: 5.12.0

This patch to plasma-workspace is to improve the quality of images in notifications as reported in [[ https://bugs.kde.org/show_bug.cgi?id=385097 | Bug 385097 ]].

It is still not perfect because KIO::PreviewJob is used to create the thumbnail, and it only produces two sizes, 128px and 256px, so it is likely that a small image will be scaled up, blurring it somewhat.

I took two screenshots of the same Dolphin window. Here is the before, without the patch:
{F5665511}

And the after, with the patch:
{F5665513}

Better, but still not perfect.

Test Plan: Take screenshots with Spectacle with and without the patched libnotificationshelperplugin library and observe the image quality in the notification. plasmashell must be restarted when the library file is changed for it to take effect.

Reviewers: #plasma_workspaces, #plasma, broulik

Reviewed By: #plasma_workspaces, #plasma, broulik

Subscribers: broulik, ngraham, plasma-devel, #plasma_workspaces, #plasma

Tags: #spectacle, #plasma

Differential Revision: https://phabricator.kde.org/D9993
parent 562e5675
......@@ -212,7 +212,8 @@ void Thumbnailer::generatePreview()
return;
}
KIO::PreviewJob *job = KIO::filePreview(KFileItemList({KFileItem(m_url)}), m_size);
auto maxSize = qMax(m_size.width(), m_size.height());
KIO::PreviewJob *job = KIO::filePreview(KFileItemList({KFileItem(m_url)}), QSize(maxSize,maxSize));
job->setIgnoreMaximumSize(true);
connect(job, &KIO::PreviewJob::gotPreview, this, [this](const KFileItem &item, const QPixmap &preview) {
......
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