Don't draw frames and shadows around images with transparency
Summary:
This patch improves and simplifies the criteria for whether or not to draw a frame and a shadow around an image's thumbnail. The old size-based detection code was unreliable and gave false positives as well as false negatives. It is replaced with a simple check for whether the image has an alpha channel, which not only automatically matches all icon files, but also non-icon raster images with transparency, which look better without the frame.
BUG: 258514
FIXED-IN: 5.50
Test Plan:
PNG with no transparency
Previously most would get frames, but some wouldn't, depending on their dimensions. Now all do.
Before:
After:
PNG with transparency
Previously most would get frames, but some wouldn't, depending on their dimensions. There was also a bug where screenshots that includes shadows got a double shadow (one from the image itself, another from the frame-and-shadow. Now none get the frame.
Before:
After:
Before:
After:
Before:
After:
Before:
After:
Before:
After:
JPEG
Previously most would get frames, but some wouldn't, depending on their dimensions. Now all do.
Before:
After:
SVG
Previously most (but not all) icon SVGs would not get frames, but some would, depending on their dimensions. Non-icon SVGs would mostly get frames, but some would not, depending on their dimension. Now they only do if they have transparency.
Before:
After:
Before:
After:
Reviewers: Frameworks, Dolphin, VDG, broulik, cfeck, abetts
Reviewed By: VDG, broulik, abetts
Subscribers: anthonyfieroni, markg, abetts, bruns, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D15071