previewjob: Use thumbnailer files for any mimetypes we don't have a plugin for
This change modifies previewjob.cpp
and adds standardthumbnailjob.cpp
. This is just a first step so that we could possibly utilize these "standard thumbnailers" over the plugin system to avoid duplicate work.
Instead of having to create a new plugin for every filetype, we can utilize binaries usually installed in /usr/share/thumbnailers
. These standard thumbnailers are simple binaries that take input file and produce an image of a supported mimetype.
The change tries to be as unintrusive as possible, relying on the plugin system most of the time: If a file mimetype is already handled by any of our plugins, we use those. "Standard thumbnailers" are only used in cases where our own plugins do not handle the mimetype.
The thumbnailers will have their own "fake" plugins created, so they can be toggled on and off from preview settings. When running the thumbnailers first time, users have to enable them first, since they're off by default.
The difference between real plugin JSON files and "fake" plugin JSON files is that the "fake" ones have standardthumbnailer
in the description
field. This is used to tell the previewjob, do we use a binary file or plugin.
When it comes to systems relying on these plugins, like Dolphin preview settings, they see even these thumbnailer binaries as regular plugins.
Screenshot of STL thumbnails using stl-thumb