Score:14

How to add WebP support to Eye of GNOME

vn flag

WebP image files are becoming more and more common on the web. Eye of GNOME (eog) doesn't support it out-of-the-box. Some browsers do, and ImageMagick just installing webp package (magick/convert -list format).

A simple search let you to webp-pixbuf-loader but might be not that easy for beginners.

Reference

Score:6
vn flag

Follow these steps to add WebP support to Eye of GNOME:

  1. Prebuild

    sudo apt install git meson ninja-build
    cd /tmp/
    git clone https://github.com/aruiz/webp-pixbuf-loader
    cd webp-pixbuf-loader/
    sudo ln -s /usr/lib/*/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders /usr/bin/gdk-pixbuf-query-loaders  # https://github.com/aruiz/webp-pixbuf-loader/issues/9#issuecomment-537437407
    
  2. Build on Debian/Ubuntu

    meson builddir -Dgdk_pixbuf_query_loaders_path=/usr/lib/x86_64-linux-gnu/gdk-pixbuf- 2.0/gdk-pixbuf-query-loaders
    ninja -C builddir
    
  3. Install

    sudo ninja -C builddir install
    
  4. Test

    wget -O /tmp/samplefile.webp "https://www.gstatic.com/webp/gallery/1.sm.webp"
    eog /tmp/samplefile.webp
    

Default app for .webp (image/webp internet media type)

From EOG issue eog.desktop doesn't include webp mimetype:

After installing https://github.com/aruiz/webp-pixbuf-loader eog loads webp images properly... but it is still not added as supported mime type to the .desktop file and, as a consequence, is not offered by default to open those images

To fix this:

# Get info
xdg-mime query filetype /tmp/samplefile.webp      # MIME type of the file: image/webp
xdg-mime query default image/webp                 # .desktop filename of the application which is registered

# Set open .webp with eog
xdg-mime default org.gnome.eog.desktop image/webp # Ask the desktop environment to make application the default application for opening files of type mimetype: Search on ~/.local/share/applications/ (user-wide) or /usr/share/applications/ (system-wide).
sudo update-mime-database /usr/share/mime         # Apply system-wide

# Test
xdg-open /tmp/samplefile.webp

Of course, change org.gnome.eog.desktop to whatever you want.

See also

raj avatar
cn flag
raj
I can't believe that there still isn't a `.deb` package with this that one can just install, without the need to build it from source.
Nmath avatar
ng flag
it seems that the `libwebp-dev` package is also a required dependency
in flag
`meson` failed to build until I installed `libgdk-pixbuf2.0-dev libwebp-dev` (Ubuntu 20.04).
hife avatar
cn flag
The `ln`-step is not necessary when you give the loader path when building. As Nmath, I had to install `libwebp-dev` and also `libgdk-pixbuf2.0-dev`.
hife avatar
cn flag
Finally, I had to symlink/move ´libpixbufloader-webp.so´ from `/usr/local/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders` to `/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders`, then run `sudo /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache` to make it work.
Score:3
to flag

I found this OMG! Ubuntu! article: How to Add WebP Support to Ubuntu 22.04 LTS

Just add the ppa:helkaluin/webp-pixbuf-loader PPA:

sudo add-apt-repository ppa:helkaluin/webp-pixbuf-loader

Then install webp-pixbuf-loader:

sudo apt install webp-pixbuf-loader

and you're done. Works for me on Ubuntu 20.04.

Score:3
ng flag

Ubuntu 22.04

You simply need to install webp-pixbuf-loader and make EOG the default program for webp extensions.
sudo apt install webp-pixbuf-loader

Ubuntu 20.04

For previous versions of Ubuntu you can add ppa:helkaluin/webp-pixbuf-loader PPA and proceed similarly.

sudo add-apt-repository ppa:helkaluin/webp-pixbuf-loader
sudo apt update
sudo apt install webp-pixbuf-loader
bt flag
Great! Now if there was also one for .avif ...!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.