Bug 490425

Summary: no option to make wallpaper pixel-perfect Center option for wallpaper doesn't do anything
Product: [Plasma] plasmashell Reporter: warren <d7cruiser>
Component: Image WallpaperAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: kde, kdedev, nate, notmart, postix, qydwhotmail
Priority: NOR    
Version: 6.1.2   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.1.4
Sentry Crash Report:
Attachments: Screenshot of 5120x2160 centered on 3440x1440 display
Screenshot of 5120x2160 centered on 3440x1440 display
Graphic visually comparing the relative sizes of display resolutions

Description warren 2024-07-17 23:59:53 UTC
I've noticed that the "centered" option in Desktop Settings is effectively the same as "scaled, keep proportions." This means there's no option to have a pixel-perfect background image without manually cropping it to fit the screen.

STEPS TO REPRODUCE
1. pick an image that's bigger than your screen resolution
2. try the centered position in the Desktop Settings menu

OBSERVED RESULT
The image is scaled down and anti aliased similar to the "scaled, keep proportions" option.

EXPECTED RESULT
The image is zoomed in and cropped to show it's true resolution

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Tried on EndeavourOS
Comment 1 David Edmundson 2024-07-18 13:15:17 UTC
If you need custom control, edit the image yourself.
Comment 2 TraceyC 2024-07-19 20:05:32 UTC
I've done some testing and I found that the behavior of centering wallpaper is different depending on if the wallpaper is larger or smaller than the display resolution.

When using an image smaller than the display resolution, centering the wallpaper (and other settings) works as expected. 
The result is different than "scaled, keep proportions" 

When using an image larger than the display resolution, centering the wallpaper (and other settings) *also* reduces the image size, as reported. 
The result is the same as "scaled, keep proportions", as reported.

Configuration: 

Laptop in docking station with 2 external monitors
Dell XPS laptop internal screen    2560x1600
LG external screen (DisplayPort)   3440x1440
LG external screen (HDMI)          3440x1440

Tested wallpapers on one 3440x1440 monitor

Test: Image is smaller than the display
Wallpaper size              1920x1080
Settings work as expected

Test: Image is bigger than the display
Wallpaper size              5120x2160
I'm adding an attachment to show how this wallpaper is displayed in Centered mode on my display.
I added a red border to the wallpaper image to make it easier to see that it's scaled down. The white borders on the side are because the image has a slightly more narrow ratio.

I'm adding a second attachment to show the visual difference between the two resolutions, and the rough area I'd expect to see of the large wallpaper.
Comment 3 TraceyC 2024-07-19 20:12:41 UTC
Created attachment 171799 [details]
Screenshot of 5120x2160 centered on 3440x1440 display

A red border was added to the jpg to make it easier to see where the image border is
The image has been reduced in visual size
Comment 4 TraceyC 2024-07-19 20:16:24 UTC
Created attachment 171800 [details]
Screenshot of 5120x2160 centered on 3440x1440 display
Comment 5 TraceyC 2024-07-19 20:17:50 UTC
Created attachment 171801 [details]
Graphic visually comparing the relative sizes of display resolutions

This shows how much larger a 5120x2160 wallpaper is compared to a 3440x1440 display
Comment 6 Bug Janitor Service 2024-07-24 09:09:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4551
Comment 7 Marco Martin 2024-07-29 15:56:45 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 489250

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:24 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 489250


(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