ngraham created this revision. ngraham added reviewers: Frameworks, Dolphin, VDG, broulik, cfeck. Herald added a project: Frameworks. Herald added a subscriber: kde-frameworks-devel. ngraham requested review of this revision.
REVISION 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 Verified unchanged: - SVG icons still have no frame: - JPEG and PNG images without transparency still have a frame: Verified changed: - Non-icon SVG and PNG images with transparency lose their frames. The difference is especially welcome for the cases where the previous set of criteris caused many false positives for folders full of mixed image formats and sizes. For example: Before: After: Before: After: Before: After: REPOSITORY R241 KIO BRANCH thumbnail-frame-refinement (branched from master) REVISION DETAIL https://phabricator.kde.org/D15071 AFFECTED FILES src/filewidgets/kfilepreviewgenerator.cpp To: ngraham, #frameworks, #dolphin, #vdg, broulik, cfeck Cc: kde-frameworks-devel, michaelh, ngraham, bruns