Bug 489250 - "Scaled" and "Scaled and cropped" placement modes apply poor scaling to high resolution wallpapers in bundle/package form
Summary: "Scaled" and "Scaled and cropped" placement modes apply poor scaling to high ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image Wallpaper (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-26 17:56 UTC by Жора Змейкин
Modified: 2024-07-31 22:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.4
Sentry Crash Report:


Attachments
The wallpaper that I'm installing (2.70 MB, image/png)
2024-06-26 17:56 UTC, Жора Змейкин
Details
This is a cropped screenshot of the desktop. Here, the wallpaper was set via the context menu. (197.75 KB, image/png)
2024-06-26 17:57 UTC, Жора Змейкин
Details
This is a cropped screenshot of the desktop. Here the wallpaper was installed via /usr/share/wallpapers/.. Here you can notice a small blur (196.35 KB, image/png)
2024-06-26 17:59 UTC, Жора Змейкин
Details
Archive with an image (3.53 MB, application/gzip)
2024-06-28 06:31 UTC, Жора Змейкин
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Жора Змейкин 2024-06-26 17:56:11 UTC
Created attachment 171026 [details]
The wallpaper that I'm installing

SUMMARY
We created our wallpapers in 3000x3000 resolution and set them as desktop wallpapers through the context menu. They looked clear and everything was fine. 

Our next step was to prepare the wallpaper as a system wallpaper for all users. We put the wallpaper in "/usr/share/wallpapers/Wallpaper Name/content/images/3000x3000.png", having previously filled in the metadata file.json

After preparation, we apply these wallpapers through the system parameters and suddenly notice that the picture quality has deteriorated. The problem was solved by reducing the image resolution to 3000x1687, but it seems to me that this is a bug and this should not be.

STEPS TO REPRODUCE
1. Take a wallpaper of 3000x3000 or higher (attached to this message)
2. Put the wallpaper in "/usr/share/wallpapers/Folder/contents/images" or "~/.local/share/wallpapers/Folder/contents/images" (you should also configure metadata.json)
3. Open the system settings and apply the wallpaper.

OBSERVED RESULT
The wallpaper is slightly blurred, losing quality.

EXPECTED RESULT
High-quality wallpapers, as when they are installed through the context menu.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Unstable
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.0
Graphics Platform: Wayland
Screen Resolution: 1920x1080 (the global scale is not used)

ADDITIONAL INFORMATION
This bug is also relevant in KDE Plasma 5.27.11 and 6.1.1. Just below I will take two screenshots where the difference between wallpapers installed through the context menu and wallpapers installed in another way will be clearly visible
Comment 1 Жора Змейкин 2024-06-26 17:57:27 UTC
Created attachment 171027 [details]
This is a cropped screenshot of the desktop. Here, the wallpaper was set via the context menu.
Comment 2 Жора Змейкин 2024-06-26 17:59:16 UTC
Created attachment 171028 [details]
This is a cropped screenshot of the desktop. Here the wallpaper was installed via /usr/share/wallpapers/.. Here you can notice a small blur
Comment 3 Nate Graham 2024-06-27 20:12:00 UTC
Can you attach a compressed .tar.gz of the entire folder so we can replicate your exact setup better?
Comment 4 Жора Змейкин 2024-06-28 06:31:25 UTC
Created attachment 171114 [details]
Archive with an image

(In reply to Nate Graham from comment #3)
> Can you attach a compressed .tar.gz of the entire folder so we can replicate
> your exact setup better?

Yes, of course. This archive should be unpacked to "~/.local/share/wallpapers/" or to "/usr/share/wallpapers/"
Comment 5 Nate Graham 2024-07-23 18:53:44 UTC
Thanks for attaching it. I can't reproduce the issue with current git master when I apply the wallpaper on my 4k screen with 225% scale. I'll give it another go with a 1080p external screen in a little while.
Comment 6 Nate Graham 2024-07-24 18:37:06 UTC
I can reproduce the issue on a 1080p screen at 100% scale when using the "Scaled" or "Scaled and cropped" placement modes.

When I apply the same image as a standalone image (not as a bundle inside ~/.local/share/wallpapers/etc etc etc), the issue is not seen.
Comment 7 Marco Martin 2024-07-29 15:56:34 UTC
Git commit ada62d202f9f60b8650d50a43818c082031598dc by Marco Martin.
Committed on 29/07/2024 at 15:56.
Pushed by mart into branch 'master'.

Respect centered images size

Centered images should be cropped all around if they are bigger than the
screen, so we can't limit their sourceSize to the desktop size

Use the provider only for svgs:
Image always considers images from image providers as scalable
(QQuickPixmap::isScalableImageFormat) which changes the internal
calculation of the size, having images being rendered on different sizes
depending if they are loaded from package or directly
Related: bug 490425

M  +2    -1    wallpapers/image/imagepackage/contents/ui/mediacomponent/StaticImageComponent.qml
M  +8    -6    wallpapers/image/plugin/autotests/tst_imagebackend.qml
M  +2    -2    wallpapers/image/plugin/autotests/tst_imagefrontend.cpp
M  +2    -1    wallpapers/image/plugin/utils/backgroundtype.h
M  +5    -1    wallpapers/image/plugin/utils/mediaproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ada62d202f9f60b8650d50a43818c082031598dc
Comment 8 Marco Martin 2024-07-29 16:31:16 UTC
Git commit f480c5eb8a8dd7ea30cdfc6930452ef7c46d9212 by Marco Martin.
Committed on 29/07/2024 at 16:31.
Pushed by mart into branch 'Plasma/6.1'.

Respect centered images size

* Respect centered images size

Centered images should be cropped all around if they are bigger than the
screen, so we can't limit their sourceSize to the desktop size

Use the provider only for svgs:
Image always considers images from image providers as scalable
(QQuickPixmap::isScalableImageFormat) which changes the internal
calculation of the size, having images being rendered on different sizes
depending if they are loaded from package or directly
Related: bug 490425


(cherry picked from commit ada62d202f9f60b8650d50a43818c082031598dc)

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +2    -1    wallpapers/image/imagepackage/contents/ui/mediacomponent/StaticImageComponent.qml
M  +8    -6    wallpapers/image/plugin/autotests/tst_imagebackend.qml
M  +2    -2    wallpapers/image/plugin/autotests/tst_imagefrontend.cpp
M  +2    -1    wallpapers/image/plugin/utils/backgroundtype.h
M  +5    -1    wallpapers/image/plugin/utils/mediaproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/f480c5eb8a8dd7ea30cdfc6930452ef7c46d9212