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. However, if a file mimetype is:
- Plugin that "owns" the mimetype is not disabled (there is some exceptions, more of them later)
- Not found in any of our plugins
We take the mimetype, ask the standard thumbnailers if they can run it, and if so, we produce a thumbnail through it. If there is no fitting mimetype in the thumbnailers either, we just ignore the file.
Screenshot of STL thumbnails using stl-thumb
The exceptions I mentioned above come with some image plugins, since there is for some reason an image plugin for JPEG
files and any other image files.
The JPEG plugin handles image/jpeg
mimetype, and the other image plugin handles image/*
plugin. This causes confusion by the preview handling, so users who have disabled only one of them will likely see all image files.
My hope is to make all images run through same plugin, so it would only have image/*