Bug 414776 - Rendering glitch when moving in an zoomed PNG with Alphachannel (RGBA)
Summary: Rendering glitch when moving in an zoomed PNG with Alphachannel (RGBA)
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 20.04.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
: 418314 (view as bug list)
Depends on:
Reported: 2019-12-02 22:49 UTC by postix
Modified: 2021-02-01 19:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.12.2

Screenshot of the issue. (260.48 KB, image/png)
2019-12-02 22:49 UTC, postix
Video demonstration. (741.83 KB, video/mp4)
2020-01-13 17:23 UTC, postix
Another video. (3.19 MB, video/mp4)
2020-01-13 17:41 UTC, postix

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2019-12-02 22:49:37 UTC
Created attachment 124282 [details]
Screenshot of the issue.


Please the see screenshot.

1. Open the sample SVG
2. Set display to 100%
3. Hold down the mouse in the image and start moving around

Operating System: Manjaro Linux 
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2
Comment 1 postix 2019-12-02 22:50:43 UTC

Comment 2 postix 2019-12-02 22:51:13 UTC
Sorry, it was about a PNG and since it's too big to attatch, here's the link to it: https://phabricator.kde.org/file/data/u5v4zfmgnlmz5udo44vn/PHID-FILE-g7vlhcvnjoizz3fzjm7c/dolphin_4x.png
Comment 3 postix 2020-01-13 17:23:41 UTC
Created attachment 125096 [details]
Video demonstration.

Can anyone please try to reproduce it? It renders Gwenview completely unuseable to me for PNGs. :-( 

If the glitch appears it can be "healed" reloading the image via F5.

I don't have this issue with JPEGs or RAW (CR2) files.
Comment 4 postix 2020-01-13 17:41:53 UTC
Created attachment 125098 [details]
Another video.

This is another example where not the background becomes visible, but parts of the images don't get updated: First if I press F5 and the refreshing circle vanishes again, the image appears like it should.

P.S. Sorry about the flickering on the right side, which is another issue of something else, where I'm not sure where to report it.
Comment 5 postix 2020-01-13 17:46:39 UTC
Graphics settings:

inxi -G
Graphics:  Device-1: Intel HD Graphics 620 driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.6 driver: intel unloaded: modesetting resolution: 2560x1440~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 620 (Kaby Lake GT2) v: 4.6 Mesa 19.3.1
Comment 6 postix 2020-05-04 15:41:57 UTC
I made an important observation:

This bug occurs ONLY for RGBA PNGs, i.e. for PNGs with an alpha-channel attached!

So, if add an alpha-channel via GIMP (Layer->Tansparency->Add Alphachannel) to an RGB PNG and save it again as PNG, the bug starts occuring.

You can check if there's an alpha-channel via
$ file myimage.png
$ myimage.png: PNG image data, 706 x 970, 8-bit/color RGBA, non-interlaced

I hope this helps for reproducing and finding the root of this issue.
Comment 7 postix 2020-05-10 09:27:41 UTC
I could not reproduce it on another notebook with Manjaro + i915 driver.
(Intel Pentium, X.Org 1.20.8, OpenGL: Mesa HD Graphics 505 (APL 3), v:4.6 Mesa 20.0.6)

Maybe something is broken on my system and the bug will vanish once I do a clean re-installation.
Comment 8 postix 2020-05-21 09:08:06 UTC
The symptoms looks similar to this Qt bug regarding fractional scaling: 

* https://bugreports.qt.io/browse/QTBUG-82601#add-comment
* https://bugreports.qt.io/secure/attachment/92518/scaling-issue.gif
Comment 9 Matej Mrenica 2020-07-09 17:58:45 UTC
*** Bug 418314 has been marked as a duplicate of this bug. ***
Comment 10 postix 2020-10-04 14:12:18 UTC
Issue remains with the modesettings driver instead of the xf86-video-intel.
Comment 11 Andrew Udvare 2020-10-19 21:03:20 UTC
I have this issue with any kind of image. I'm on 150% scale with Nvidia drivers.

This happens when I move the image with the hand cursor. It is less likely to happen when using the widget on the bottom right.
Comment 12 Vlad Zahorodnii 2021-02-01 18:36:12 UTC
Git commit 955df5addac77b49c8349e6477806dbf27bde238 by Vlad Zahorodnii.
Committed on 01/02/2021 at 18:35.
Pushed by vladz into branch 'release/20.12'.

Fix visual artifacts when panning zoomed in image on HiDPI

The size of the viewport rectangle needs to be in the device-independent
pixels; otherwise there will be visual artifacts when panning a zoomed in
translucent image.
Related: bug 417342, bug 428397

M  +6    -6    lib/documentview/rasterimageview.cpp

Comment 13 postix 2021-02-01 19:22:45 UTC
Thank you so much, Vlad!!! :)