I’m finding that more of the images I save from the web are in the WebP format, yet not all Linux distros support it out-of-the-box.
So in this post I show you how to do something about it.
Websites are keen to embrace this Google-made image format as it offers a better balance between image quality and file size, making websites using the format faster to load, even on slower networks, resulting in a better overall user experience.
But while all major web browsers support WebP natively you may have noticed that not all apps running on the GNOME desktop do. For instance, you won’t see thumbnails for
.webp files in the Nautilus file manager, and you can’t open a
.webp image in Eye of GNOME, the default image viewer.
Well, GTK apps (like Nautilus) use the Gdk-pixbuf Image loading library. At present this library doesn’t include support for WebP natively. And based on the last time the issue was discussed that situation won’t be changing soon!
There is good news, though. There exists a free, open-source library that brings WebP support to gdk-pixbuf and, by extension, any GTK apps using it it, such as the Nautilus file manager.
So instead of seeing a generic placeholder icon for WebP images in Nautilus, like this:
We see a full thumbnail preview of the image in-situ, like this:
webp-pixbuf-loader to the rescue
What makes the ‘webp-pixbuf-loader’ library great (besides, y’know, working) is that it’s already packaged up in most major Linux distributions.
If you use Fedora, openSUSE or an Arch-based distro you can install the webp-pixbuf-loader from your distribution’s archive using the command line or a GUI package manager.
Personally, I like to install using the command line (it’s quicker for me) so to install webp-pixbuf-loader in Fedora I just have to open a Terminal window and run:
sudo dnf install webp-pixbuf-loader
And that takes care of everything.
Are you using Ubuntu? If you are things are a little less elegant. You can choose to build the library from source code (low risk, high effort – full intersections on GitHub) or opt to install the library from a third-party PPA (high risk, low effort – caveats about random repos apply).
Whatever route you choose, once you install the WebP image loader library you’re good to go.
Close any/all GTK apps you want to see WebP images in, and when you reopen them, you should be golden. You’ll be able to see thumbnails for WebP images in Nautilus (and similar) apps, right alongside thumbnails for all other supported image files — nice!
You’ve see how easy it is to patch in WebP support to GNOME’s default file manager and assorted GTK apps. WebP support is likely to get added natively to most Linux distributions in time, but for now this simple, no-fuss workaround is ideal.