Bug 338492 - File icon previews should be turned on for all icon types by default
Summary: File icon previews should be turned on for all icon types by default
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 17.07.80
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 225611 338493 349106 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-23 08:26 UTC by Michael
Modified: 2017-11-16 02:49 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2014-08-23 08:26:10 UTC
File icon previews should be turned on for all icon types by default because this is 2014 and to see a generic icon where a miniature image thumbnail could be, or a miniature office document page could exist is *unfriendly* for such an advanced OS as KDE.

In contrast to Kubuntu, there is Windows 7/8, Mac OS, and Ubuntu which all show icon previews of files by default in their respective file explorers.

So in the Dolphin -> Settings -> Configure Dolphin -> General tab -> Previews tab, all the items should be checked by default. They also should be checked by default when any new file type is added to the system [if the others were also checked by default], such as recently Marble added new KML types to my system that were disabled for preview even though I have manually checked all the other types. 

One thing is broken with file previews that will soon become evident if this request is fulfilled: having the "Text Files" and the "Desktop Files" types enabled makes .desktop files show an ugly _text preview_ of the .desktop internals instead of the intended .desktop icon.

Thank you for listening. I've installed Kubuntu on a fair number of machines and there's some things that I've had to do over and over just to get an experience that my friends are expecting. Making all file previews display by default would be an easy change the perceived friendliness of KDE.

This would make sense to go hand-in-hand with having file previews turned on by default in Desktop containment views as well.
Comment 1 Michael 2014-08-23 09:12:44 UTC
The related bug for Plasmashell 5.0 icon previews is here - https://bugs.kde.org/show_bug.cgi?id=338493
Comment 2 Michael 2014-08-23 09:15:31 UTC
Correction: Currently, only raster image types are shown by default for previews.
Comment 3 Eike Hein 2015-01-08 16:15:32 UTC
I think Folder should follow Dolphin's lead here, or maybe we need to centralize the config for this. I'm going to close this as a dupe (which puts me on the CC list).
Comment 4 Eike Hein 2015-01-08 16:16:01 UTC
*** Bug 338493 has been marked as a duplicate of this bug. ***
Comment 5 Eike Hein 2015-01-08 16:16:19 UTC
Sorry, the above comment was meant for bug 338493.
Comment 6 Emmanuel Pescosta 2015-01-08 17:12:08 UTC
(In reply to Eike Hein from comment #3)
> I think Folder should follow Dolphin's lead here, or maybe we need to
> centralize the config for this. I'm going to close this as a dupe (which
> puts me on the CC list).

+1 for centralizing the config

I also think that we should turn on previews for (almost) all types by default.
Comment 7 Nate Graham 2017-08-18 17:31:16 UTC
*** Bug 225611 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2017-08-20 18:58:56 UTC
I've submitted a patch for this here: https://phabricator.kde.org/D7440
Comment 9 Michael 2017-08-21 03:55:03 UTC
(In reply to Nate Graham from comment #8)
> I've submitted a patch for this here: https://phabricator.kde.org/D7440

Great! :)

Regarding the comment: 

"Tested this change in an up-to-date KDE Neon. Works as expected: previews are turned on for all file types (except for windows exe files, which seems like a bit of a security risk)."

... I'm not clear on how parsing out icons from Windows .exe files are a security risk. It then makes me wonder: how are .exe files parsed? Are they scanned for a resource chunk where the icon is read and then displayed? Or something else?

But very good that this other preview types are turned on by default, thank you!
Comment 10 Nate Graham 2017-08-21 04:08:55 UTC
My thought was that since .EXEs contain executable code, parsing them for icons contains the risk of executing maliciously-crafted code. But I have no idea how the parsing is actually done, or even what it does (I have no windows EXEs handy to test). It's trivial to turn that on by default too if people find themselves feeling strongly about the matter.
Comment 11 Michael 2017-08-23 22:12:15 UTC
(In reply to Nate Graham from comment #10)
> My thought was that since .EXEs contain executable code, parsing them for
> icons contains the risk of executing maliciously-crafted code. But I have no
> idea how the parsing is actually done, or even what it does (I have no
> windows EXEs handy to test). It's trivial to turn that on by default too if
> people find themselves feeling strongly about the matter.

I'm not convinced that a user would even begin to wonder if an .exe was being executed to find its icon. That kind of thought would only come from a developer, not a user. But being developers, we can go beyond feelings and test our assumptions on the matter.

Back when I was a full-time Windows programmer and I had to embed icons into my .exe's, I told VisualStudio "take this .ico file and embed it into the resulting .exe in your resource data chunk". It was a post-processing step.

There are other bits of data that can be embedded into an .exe's resource data chunk, like menus, dialog layouts, images--not just icons. 

Microsoft talks about resource files when building .exe's here:

  https://msdn.microsoft.com/en-us/library/windows/desktop/aa380599(v=vs.85).aspx

There's actually a Windows tool that will allow you to inspect, add, remove resources in .exes so you can see that icons are resource types, and not related to code.

  http://angusj.com/resourcehacker/

There's a Linux command line tool that works with .exe resources too:

  http://man7.org/linux/man-pages/man1/windres.1.html

Another thing to note: KDE running on an ARM CPU like a Raspberry Pi will still be able to view an x86 .exe's icons even though the CPU architectures are dissimilar. This is because the ARM doesn't need to execute x86 code to get to the icon resource. It just opens up the .exe and looks for the resource data chunk and parses that.

Finally, if you need to have an .exe that has an icon in its resource chunk to test this, you can download ProcessExplorer here: 

  https://download.sysinternals.com/files/ProcessExplorer.zip
Comment 12 Nate Graham 2017-09-03 17:02:41 UTC
*** Bug 349106 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2017-11-16 02:49:26 UTC
Git commit bebcf035d264410c943e7bad861628c1b14dd1f2 by Nathaniel Graham.
Committed on 16/11/2017 at 02:49.
Pushed by ngraham into branch 'master'.

Turn on Dolphin icon previews by default

Summary:
Related: bug 350212

By default, turn on all preview plugins and turn on previews themselves.

Depends on D8347

Test Plan:
Tested this change in an up-to-date KDE Neon: removed the existing dolphinrc file, deployed Dolphin with the change, and observed that previews are now turned on for all file types for which a plugin exists except for text files, which are in the blacklist because they're mostly useless at nearly all icon sizes (still available in case people want them, though).

Here's how Dolphin's main window looks by default now in KDE Neon:

{F5441184}
(You may notice that there are no previews for the video files; that's because Neon doesn't ship with any plugins for them, so that would be expected at this point)

And here is how the Settings > General > Preview window looks like now by default:
{F5435391}

Reviewers: #dolphin, #vdg, markg, abetts, dfaure, aseigo, elvisangelaccio

Reviewed By: #vdg, abetts, dfaure, elvisangelaccio

Subscribers: abetts, cfeck, andreaska, emmanuelp, andreask, markg, broulik, anthonyfieroni, davidedmundson, ltoscano, dfaure, elvisangelaccio, #konqueror

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D7440

M  +1    -1    CMakeLists.txt
M  +4    -4    src/kitemviews/kfileitemmodelrolesupdater.cpp
M  +1    -1    src/settings/dolphin_directoryviewpropertysettings.kcfg
M  +6    -6    src/settings/general/previewssettingspage.cpp
M  +6    -5    src/views/dolphinitemlistview.cpp

https://commits.kde.org/dolphin/bebcf035d264410c943e7bad861628c1b14dd1f2