I am looking for a way to get WebP image thumbnails in GTK applications (especially Nautilus / GNOME files), and Most solutions I found out that it was’hacky’ until I found out that it was quite unknown WebP GDK Pixbuf loader library . So I think I will write this article on Linux Uprising in case some of you are also interested in it.
This library/WebP thumbnail currently only supports static WebP images, but have a job Added support for animated WebP image thumbnails.
Library already Packaged and available In Fedora, Arch Linux/Manjaro, openSUSE Tumbleweed, etc., so you can install it from the repository in these cases. It is not available in the Debian / Ubuntu repositories, so if you are using it, you need to build it from source (instructions at the bottom of this page).
Install it in Fedora, Arch Linux / Manjaro or openSUSE Tumbleweed:
- Fedora hat:
sudo dnf install webp-pixbuf-loader
- Arch Linux / Manjaro:
sudo pacman -S webp-pixbuf-loader
- openSUSE Tumbleweed:
sudo zypper install webp-pixbuf-loader
To install it on Debian/Ubuntu (and Pop!_OS, Linux Mint, Elementary OS, etc.), you need to download from source . First install its build dependencies:
sudo apt install libwebp-dev libgdk-pixbuf2.0-dev meson build-essential
Next, download the latest webp-pixbuf-loader
.tar.gz Archive from Publish page , And extract the archive. Then open a terminal, navigate to the folder where you extracted the archive, and use the following 3 commands to build and install it:
meson builddir -Dgdk_pixbuf_query_loaders_path=/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
ninja -C builddirsudo ninja -C builddir install
Install webp-pixbuf-loader on Ubuntu (or Debian), the thumbnail file has Wrong location of
gdk-pixbuf-thumbnailer . To fix it, we need to replace
/usr/local/share/thumbnailers/webp-pixbuf.thumbnailer (Two cases). You can do this manually or use the following command (this is a command-click the row three times to select it):
sudo sed -i 's//usr/local/bin/gdk-pixbuf-thumbnailer//usr/bin/gdk-pixbuf-thumbnailer/g' /usr/local/share/thumbnailers/webp-pixbuf.thumbnailer
Now it’s time to try it! Open a GTK application, such as Nautilus or Thunar.Make sure it is not running yet, so close all instances, if it is already running, please reopen it, for example, if you use Nautilus or Thunar, you can exit all instances by running
nautilus -q or
thunar -q .
If you don’t see any thumbnails of WebP images, you can try to clear the thumbnail cache (this will delete all thumbnails, so you need to regenerate them):
rm ~/.cache/thumbnails/normal/*.pngrm ~/.cache/thumbnails/large/*.png