Version: unspecified (using KDE 4.5.3) OS: Linux When previews are enabled, there is an unsightly black border around small png files with alpha channels. Reproducible: Always Steps to Reproduce: Enable preview of small png files with alpha channels Actual Results: Black border around image previews Expected Results: No border as happens woth jpeg and others
Thanks for the report. Could you please attach a screenshot and let us know roughly the size of the original PNGs? I'm a little bit confused about the report because Dolphin per default adds always a black shadow behind image previews (an exception is only made for small and square images)
Created attachment 53961 [details] Screenshot of problem
Comment on attachment 53961 [details] Screenshot of problem Hi Peter. In fact the original pngs are rather small. I have however just noticedd that this happens also with some xcf thumbnails (780x487px).
Thanks for the update! I can solve this issue for your 38 x 38 PNGs, but not for 780x487 images: The intention of the shadow is to assure that the image is recognizable above each background (e. g. assume a nearly white JPG above a white background). The only exception where a shadow usually is not wanted are "icons". But whether something is an "icon" or "image" cannot be determined by Dolphin. Currently the algorithm is used that an icon is defined by a square size that can be divided by 8. I guess the "divide by 8" part can be dropped, which would solve your issue at least partly.
Hi Peter. Sorry for taking so long to get back to you. I see your point and it does make sense. I don't think though that it warrants major alteration. It's not that often I see those previews so I think our time would be better spent correcting some more useful ;)
In Bug 364527 there is a screenshot (http://imgur.com/a/ExRCx) comparing rendering of SVG previews between Nautilus and Dolphin. The shadows in Dolphin do look quite out of place. Gwenview on the other hand does not display the frame/shadow for SVGs or raster images with an alpha channel. I think Dolphin should work the same way.
See also the same request for Dolphin: Bug 378701.
*** Bug 127291 has been marked as a duplicate of this bug. ***
Submitted a patch: https://phabricator.kde.org/D15071
Git commit 418dc73262ea41cf12eec2b078ddf8bf1068ba45 by Nathaniel Graham. Committed on 05/09/2018 at 19:25. Pushed by ngraham into branch 'master'. 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. 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: {F6215116} After: {F6215118} == 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: {F6215109} After: {F6215110} Before: {F6214261} After: {F6214262} Before: {F6214955} After: {F6214956} Before: {F6214259} After: {F6214260} Before: {F6214264} After: {F6214265} == JPEG == Previously most would get frames, but some wouldn't, depending on their dimensions. Now all do. Before: {F6214939} After: {F6214940} == 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: {F6214943} After: {F6214944} Before: {F6214977} After: {F6214968} 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 M +1 -8 src/filewidgets/kfilepreviewgenerator.cpp https://commits.kde.org/kio/418dc73262ea41cf12eec2b078ddf8bf1068ba45