XDG-thumb for preview & thumbs for non-image files #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements a cache for thumbnails and image previews for non-image file formats, like videos and PDFs.
This patch extends the inbuilt image preview feature (285df85) by integrating the
allmytoes
crate and using its thumbnails instead of the actual file being previewed.The image-preview feature uses the XDG-(freedesktop.org-) specified thumbnail-cache to re-use existing thumbs and to store newly created thumbs.
(https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html)
This increases performance for the image-preview because the preview does not need to load the full-sized version of the image and does not need to scale it down every time, once the thumbnail has been created. Also, thumbnails are now shared with other programs that use the XDG-thumb cache.
Furthermore, the new way to obtain thumbs allows to show image-previews for file types other than images. Existing thumbnails are shown for any file type. New thumbnails can be created for many video formats, PDF files, Postscript files, and SVGs. Users can also add “providers” for other file-types by configuring
allmytoes
.The XDG-thumb feature can be disabled, and the thumbnail-size can be changed, both in
joshuto.toml
. The documentation has been extended, the whole image-preview page has been enhanced a little.