Bug 493432 - Background color not filling in entire window
Summary: Background color not filling in entire window
Status: ASSIGNED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 24.12.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 460313 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-21 12:17 UTC by Andre Kalouguine
Modified: 2025-01-18 14:08 UTC (History)
4 users (show)

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


Attachments
A video recording of the problem (1.12 MB, video/webm)
2024-09-21 12:17 UTC, Andre Kalouguine
Details
Patch (1.03 KB, patch)
2025-01-18 08:40 UTC, Yaroslav Sidlovsky
Details
Gwenview displaying after patch applied (138.14 KB, image/png)
2025-01-18 08:48 UTC, Yaroslav Sidlovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Kalouguine 2024-09-21 12:17:15 UTC
Created attachment 173932 [details]
A video recording of the problem

SUMMARY
Opening a large png image with transparency and turning on either "Solid colour background" or "Checkerboard background" results in the background only filling in the top left part of the image. The rest still has the default dark-gray background.

STEPS TO REPRODUCE
1. Go to Gwenview settings, turn on "Solid colour background"
2. Open large PNG image with transparency. Example I used: the 2D example at https://github.com/amv213/ComponentLibrary

OBSERVED RESULT
Only top left part of image gets the requested background

EXPECTED RESULT
Solid white background over the whole image

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Memory: 90.2 GiB of RAM
Graphics Processor: AMD Radeon 780M

ADDITIONAL INFORMATION
Zooming in results in the background being bigger than the window (I guess) and the problem is hidden.
Comment 1 Justin Zobel 2024-09-24 11:37:11 UTC
Can confirm this issue on git master using the provided sample file and a white background.
Comment 2 Ilya Bizyaev 2024-10-26 18:52:39 UTC
Same here with the checkerboard background.
Comment 3 Ilya Bizyaev 2025-01-17 16:30:12 UTC
*** Bug 460313 has been marked as a duplicate of this bug. ***
Comment 4 Yaroslav Sidlovsky 2025-01-18 08:40:16 UTC
I can confirm this bug.

The error is that width and height on lines 58 and 59 here https://invent.kde.org/graphics/gwenview/-/blob/6d6dc993be05d8627086464305d4f00815de9845/lib/documentview/alphabackgrounditem.cpp#L58
accounts `devicePixelRatio()` value, although `painter->drawTiledPixmap()` already draws using `devicePixelRatio()`.

Url for testing bug: https://raw.githubusercontent.com/amv213/ComponentLibrary/6446e922464240e3de5fcea8aa30266d0c46114c/imgs/2D_demo.png.

One line command to test it from console:
```
gwenview https://raw.githubusercontent.com/amv213/ComponentLibrary/6446e922464240e3de5fcea8aa30266d0c46114c/imgs/2D_demo.png
```
Comment 5 Yaroslav Sidlovsky 2025-01-18 08:40:50 UTC
Created attachment 177488 [details]
Patch
Comment 6 Yaroslav Sidlovsky 2025-01-18 08:48:27 UTC
Created attachment 177489 [details]
Gwenview displaying after patch applied

Is it displaying OK?
Comment 7 Bug Janitor Service 2025-01-18 14:08:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/313