I have too many images to search visually, so I cannot open each one of them individually.
What do I have to do or install to show DDS image previews on nautilus?
I would like to preview webp too if possible.
I have too many images to search visually, so I cannot open each one of them individually.
What do I have to do or install to show DDS image previews on nautilus?
I would like to preview webp too if possible.
Create files at
/usr/share/thumbnailers
with these names and content:DDS
From here: Write to
dds.thumbnailer
:WEBP
First install webp:
sudo apt-get install webp
.Based on this. Write to
webp.thumbnailer
:sudo gedit /usr/share/thumbnailers/webp.thumbnailer
.and restart nautilus after fully quitting it with
nautilus -q
.As pointed by @PereJoanMartorell I had to remove the files inside
~/.cache/thumbnails/fail
at least.Note
The problem with this webp approach is that all thumbnails will be 100x100 px.
But this script makes it work properly (and it can be highly simplified, see the answer below here , to not depend on ScriptEchoColor libs). Also the improved one based on it, for animated webp (looks interesting, haven't tried it yet tho, just learned webp could be animated!).
Obs.: on 18.04 and 20.04 it only works on
nemo
, on nautilus it is failing to generate the thumbnails but works to visualize'm.Some methods for previewing WebP images on Nautilus (GNOME Files) and Nautilus-based file managers (Nemo, Caja).
For Ubuntu 21.04 and later
Install
imagemagick
Get the MIME type of WebP images
image/webp
.Create a thumbnailer entry for WebP images
thumbnailers
in~/.local/share
.webp.thumbnailer
in that folder.nano
window):nano
.Note: If the MIME type you got in step 2 is not in the third line listed above (the
MimeType
key), add it to the end of the line and optionally end the line with a semicolon (;
).Clear old cached thumbnails and restart the file manager
For Ubuntu 14.04 to 20.10
Install
webp
This package provides the
dwebp
andwebpmux
tools, which will be used to convert WebP images into smaller PNG thumbnails.Get the MIME type of WebP images
image/webp
(but it could also beaudio/x-riff
or evenapplication/x-wine-extension-webp
).Create a thumbnailer script for WebP images
webp-thumbnailer-bin
in/usr/local/bin
:nano
window):nano
and return to the terminal.Note: If you use Nemo or Caja, you can place this script somewhere in your home directory and run commands like the above without
sudo
, for example:Create a thumbnailer entry for WebP images
thumbnailers
in~/.local/share
.webp.thumbnailer
in that folder.nano
window):nano
.Note: If the MIME type you got in step 2 is not in the
MimeType
key above, add it to the end of the line and optionally end the line with a semicolon (;
).Clear old cached thumbnails and restart the file manager
Notes
Thumbnails for both still and animated WebP images will be created with the above methods.
If you want the thumbnailer entry to be available to all users, place it in
/usr/share/thumbnailers
instead of~/.local/share/thumbnailers
:A GUI text editor like
gedit
can also be used to create and edit the thumbnailer entry, but if you plan to place the entry in/usr/share/thumbnailers
, usingnano
is strongly recommended.Some details for
imagemagick
'sconvert
(skip this if you don't want to know all the nitty-gritty):Other methods
Notes:
Use
gm
(for Ubuntu 16.04 and later)Install
graphicsmagick
which provides thegm
tool:The contents of
webp.thumbnailer
:Use
ffmpeg
(for Ubuntu 16.04 and later)Install
ffmpeg
The contents of
webp.thumbnailer
:Rationale: (skip this if you don't want to know the specifics)
Use
totem-video-thumbnailer
(for Ubuntu 14.04 and later)Install
totem
andgstreamer1.0-plugins-bad
The
totem
package providestotem-video-thumbnailer
, while thegstreamer1.0-plugins-bad
package comes with the codecs needed bytotem-video-thumbnailer
to handle WebP images.Note:
totem
is the default video player on GNOME desktops, so it's pre-installed on Ubuntu.The contents of
webp.thumbnailer
:totem
3.11.90 and later): see Jan Broms's answertotem
):Rationale: (skip this if you don't want to know the whys and wherefores)
Use
dwebp
(for Ubuntu 14.04 and later)Install
webp
which providesdwebp
The contents of
webp.thumbnailer
:dwebp
0.5.0 and later):dwebp
):Note: If you use Nautilus on Ubuntu 18.04 or later or Caja on Ubuntu 20.04 or later, which do not automatically scales down thumbnails larger than the default thumbnail size (128x128 or 256x256 pixels), then you should employ one of the other methods (with which output thumbnails are properly resized).
Tested on
The other solutions didn't work on my Ubuntu 20.04 and (after some stracing) I found Nautilus runs the thumbnailers through
bwrap
these days.However,
/usr/bin/convert
on my comp is symlinked to/etc/alternatives/convert
which in turn is symlinked to/usr/bin/convert-im6.q16
. The problem is, since/etc
as a whole does not happen to be bound bybwrap
as it's used by Nautilus, the final path will not be found.This works for me but you may need to adjust the exact path of
convert
:I followed @CalicoCat's instructions for generating thumbnails for static WebP images and made changes to the code in order to generate thumbnails for animated WebP images. Tested on Linux Mint 20.1. In @CalicoCat's 3rd step, change the code to the one bellow.
1. Edit the file (or create if missing)
sudo nano /usr/bin/webp-thumbnailer-bin
and replace the code with the one bellowIf you weren't following @CalicoCat's instructions before then you need to do the other steps bellow.
2. Next, make the file executable
sudo chmod +x /usr/bin/webp-thumbnailer-bin
3. Then create a webp.thumbnailer file in
/usr/share/thumbnailers
sudo nano /usr/share/thumbnailers/webp.thumbnailer
4. Copy the following contents into the file
5. Lastly, clear the thumbnail cache and regenerate thumbnails
For Nautilus:
or for Nemo
Explanation of the changes I made from @CalicoCat's answer:
I added a variable
nImgC
that gets the count of frames from the WebP file. If there is only a single frame, then the WebP image is static. Else, the WebP image is animated. So we usewebpmux
to extract the first frame and thendwebp
to save it as a usable thumbnail.For the animated WebP image's thumbnail I'm using the very first frame because using any other frame can produce artefacts in the thumbnail (
-get frame 1
is the first frame, and-get frame 0
is reserved for getting the last frame which often has pixels missing because of how some animations are compressed).Thanks to @ColioCat for the help
Thanks to @ColioCat for cutting off 2 unnecessary cut calls and simplifying the code with a little pipping.
The above code replaced the code bellow, where we first had to write our
webpmux
grabbed frame to disk, use it indwebp
to convert it to something usable bynautilus
ornemo
, and then remove it. As suggested, I'm leaving the original code snippet here.ImageMagick has an option to convert webp and dds images. The full list of supported formats are here ImageMagick formats.
Remember for this to work you need first to install ImageMagick.
Now you can add a
webp.thumbnailer
file at/usr/share/thumbnailers
with this lines:And finally clear actual cached thumbnails with this commands:
From Wikipedia Webp. As a derivative of the VP8 video format, it is a sister project to the WebM multimedia container format. So i tried totem-video-thumbnailer and it works.