Bug 385097

Summary: Notification with image: image is blurry when image aspect ratio doesn't match the aspect ratio used in the notification
Product: [Plasma] plasmashell Reporter: Patrick Silva <bugseforuns>
Component: NotificationsAssignee: Kai Uwe Broulik <kde>
Severity: normal CC: nate, plasma-bugs, rlkron2, simonandric5
Priority: NOR Keywords: usability
Version: master   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.12.0
Attachments: screenshot
plasma-workspace patch

Description Patrick Silva 2017-09-26 15:43:10 UTC
Created attachment 108041 [details]

See my screenshot.
I use neon dev unstable.
Comment 1 Randy Kron 2018-01-20 00:45:46 UTC
Same here. Plasma 5.11.5 on ArchLinux. Don't think this is a Spectacle problem, but is how the image is scaled in the notification plasmoid. Screenshots that are much wider than tall are the least blurry, and screenshots that are much taller than wide are the most blurry.
Comment 2 Randy Kron 2018-01-20 13:40:49 UTC
Created attachment 110014 [details]
plasma-workspace patch

I have a patch for plasma-workspace that improves this, but it's still not perfect because KIO::PreviewJob is being used to create the thumbnail and it only creates two sizes, 128px or 256px. So, depending on the final image size required, a smaller image will still be scaled up, blurring it somewhat.
Comment 3 Nate Graham 2018-01-20 15:17:48 UTC
Wonderful, thanks Randy. However, we can't directly accept patches in bug reports; they have to go through our review process on http://phabricator.kde.org/. Even incomplete or as a work-in-progress, it would be worth submitting your patch (with before-and-after screenshots, if possible) just to solicit comments and maybe collaboratively converge towards a solution.

Here is the documentation for how to sign up for and use Phabricator: https://community.kde.org/Infrastructure/Phabricator

Can't wait to see you there!
Comment 4 Nate Graham 2018-01-25 17:15:28 UTC
Randy helpfully submitted a patch: https://phabricator.kde.org/D9993

...And it's been accepted! If Kai doesn't land it today, I'll do it tonight.
Comment 5 David Edmundson 2018-01-26 16:55:12 UTC
Git commit bfe2539aa05536cf5e9c6b3327e5f1a6ebc91a73 by David Edmundson, on behalf of Randy Kron.
Committed on 26/01/2018 at 16:54.
Pushed by davidedmundson into branch 'Plasma/5.12'.

Improve quality of images in notifications (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:

And the after, with the patch:

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

M  +2    -1    applets/notifications/plugin/thumbnailer.cpp

Comment 6 Patrick Silva 2018-01-26 17:25:58 UTC
Improvement is welcome, but the problem reported here is not fixed.
Picture preview is still blury.
Comment 7 Nate Graham 2018-01-27 16:12:26 UTC
Re-opening since this was only half-fixed. Thankfully, Randy has submitted another patch that does the other half: https://phabricator.kde.org/D10146
Comment 8 Patrick Silva 2018-01-27 16:29:25 UTC
Thank you Nate.
Keep your great work please.
Comment 9 Nate Graham 2018-01-27 17:28:05 UTC
You're very welcome. But also thank the people doing most of the hard work! I'm mostly organizing, promoting, and trying to avoid taking credit for others' superb labors.
Comment 10 David Edmundson 2018-01-28 21:18:26 UTC
Git commit 54c13f4c8ae93dd1b17f9d9a3a1a59e384d91ff4 by David Edmundson, on behalf of Randy Kron.
Committed on 28/01/2018 at 21:18.
Pushed by davidedmundson into branch 'Plasma/5.12'.

Further improve quality of images in notifications

This revision further improves the quality of images in notifications
that was addressed in revision D9993. When I first looked into this, I
tried setting ScaleType on the PreviewJob but it had no effect. I found
that the preview images were being scaled to the small vertical size
that was requested, and this resulted in my first revision. I should
have tried setting ScaleType in addition.

Notification with unpatched libnotificationshelperplugin.so


Notification with patch applied


Test Plan:
Take screenshot with Spectacle with unpatched
libnotificationshelperplugin.so  installed and observe the blurry
preview image in the notification.

Install the patched libnotificationshelperplugin.so and restart

Take another screenshot with Spectacle and observe the much improved
quality of the preview image in the notification.

Reviewers: #plasma_workspaces, #plasma, broulik, ngraham

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

Tags: #plasma, #spectacle

Differential Revision: https://phabricator.kde.org/D10146

M  +1    -0    applets/notifications/plugin/thumbnailer.cpp