Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[request] Webp support #20

Closed
ghost opened this issue Feb 13, 2018 · 26 comments
Closed

[request] Webp support #20

ghost opened this issue Feb 13, 2018 · 26 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2018

Could you please add .webp format support to Viewnior?

@hellosiyan
Copy link
Owner

Viewnior uses gdk-pixbuf under the hood, which does not support WebP.

@Martina-Neumayer
Copy link

Yeap.. it will be a very nice to have an update for some new versions of the image formats.
Viewnior is super but lot's of images recently are simply not recognizable by the app.

@debarshiray
Copy link

There's an out-of-tree WebP backend for GdkPixbuf:
https://github.com/aruiz/webp-pixbuf-loader

Installing it should unlock WebP support.

@Martina-Neumayer
Copy link

@debarshiray Yes.. I know about it, but sadly, for me don't works.
I am using now on my Arch viewer from the XnViewMP package and it works ootb with all fileformats I need without any issues.

@debarshiray
Copy link

@Martina-Neumayer That's sad to hear. If you still have a WebP file which it failed to decode, then it might be worth filing a bug. I don't use WebP much myself, but I know the author of that decoder. :)

@Martina-Neumayer
Copy link

Martina-Neumayer commented Sep 13, 2018

@debarshiray Nope, I don't have any. The entire issue was "caused" by the add-on in the Chrome/Chromium browser which enable to save some pictures, gfx etc even if they are let's say.. not mentioned to save ootb ;) I mean by Image Toolbar add-on. And there was somehow a glitch manifested itself by saving jpg files as a webp. Strange, but it was so.
I am not entirely sure if it was only through (because) the add-on or also through some error in the system. After I migrated to Arch there is no issue at all anymore and the add-on preserve original fileformat by saving as it should be.
I think (for 80% of certainty) that this was a system related problem. But I did not have much free time those days to digg this issue a bit deeper. You know.. work and other my duties.
Sadly, that Mint is no longer as stable and unproblematic as it was before v18 and v19.

@Gooberpatrol66
Copy link

Weirdly, viewnior can open webps on one of my computers but not the other. Both running gentoo. I can't figure it out.

@Necklaces
Copy link
Contributor

@Gooberpatrol66

Weirdly, viewnior can open webps on one of my computers but not the other. Both running gentoo. I can't figure it out.

Pretty sure you've installed webp-pixbuf-loader on one and not the other. There's literally no other way for it to work.

@Gooberpatrol66
Copy link

Yes, that was it. Thanks.

@Rava77
Copy link

Rava77 commented Apr 2, 2020

I use viewnior 1.4-2 on a Slackware based system. I installed webp-pixbuf-loader-20191003.fb04954-x86_64-1_slonly - that is the most recent package to be found. Still viewnior insists on Couldn't recognise the image file format for file 'file.webp'
Could it be that I need to restart the system because even after installing webp-pixbuf-loader viewnior still uses the old gdk-pixbuf?

@Gooberpatrol66
Copy link

I don't remember restarting.

@Rava77
Copy link

Rava77 commented Apr 2, 2020

I don't remember restarting.

Then what could be the reason it is not working in my case? Any ideas?

@Necklaces
Copy link
Contributor

Necklaces commented Apr 2, 2020

@Rava77 You installed it with sudo ninja -C builddir install, right? That meson build script should have run sudo gdk-pixbuf-query-loaders --update-cache to update /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.

I guess you could check if it did by doing cat /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache | grep webp, if it returns nothing, try running sudo gdk-pixbuf-query-loaders --update-cache manually.

If it still doesn't work you have to check if the library is even installed, do a ls /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/ and make sure libpixbufloader-webp.so is there.

Edit: the paths might be slighly different on Slackware.

@Rava77
Copy link

Rava77 commented Apr 2, 2020

the paths might be slighly different on Slackware.

Indeed one is: it is /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache

The initial cat & grep gave no result. So I ran gdk-pixbuf-query-loaders --update-cache et voilà:

# cat /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache | grep webp
"/usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-webp.so"
"webp" 5 "gdk-pixbuf" "The WebP image format" "LGPL"
"image/webp" "audio/x-riff" ""
"webp" ""

And now viewnior accepts each and every webp as a valid image file and displays them all. <B

And I use a live system, so I just activated a module I created out of the slackware package. I have to look into the module to see if the gdk-pixbuf-query-loaders --update-cache is put in there somewhere (as it should), and if so, determine why that was not executed.

Thanks a lot, for now I have to manually run the gdk-pixbuf-query-loaders --update-cache , but I am working of fixing the module so that does the gdk-pixbuf-query-loaders call automatically.

@Rava77
Copy link

Rava77 commented Apr 2, 2020

Update
Checked the module. The script that got executed has this in it:

if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
  /usr/bin/update-gdk-pixbuf-loaders >/dev/null 2>&1
fi

Obviously, that is incorrect and needs to be changed into this:

if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
  /usr/bin/update-gdk-pixbuf-loaders --update-cache >/dev/null 2>&1
fi

or maybe even into this:

if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
  /usr/bin/update-gdk-pixbuf-loaders >/dev/null 2>&1
  /usr/bin/update-gdk-pixbuf-loaders --update-cache >/dev/null 2>&1
fi

@ghost
Copy link
Author

ghost commented Apr 3, 2020

There's an out-of-tree WebP backend for GdkPixbuf:
https://github.com/aruiz/webp-pixbuf-loader

Installing it should unlock WebP support.

Works for me! Thanks!

@kmvan
Copy link

kmvan commented Oct 8, 2020

In Arch:

yay -S webp-pixbuf-loader

And restart Viewnior and done.

@Lonniebiz
Copy link

This issue should not be closed until Viewnior opens webp images by default. If another package is required to accomplish this, then it should be a dependency that gets installed upon installing Viewnior.

Just because there is a work-around doesn't mean this issue should be closed.

Viewnior should at least aspire to support all image types that web browsers do (BY DEFAULT).

Browser Support of WEBP images:
https://caniuse.com/webp

WEBP Info:
https://developers.google.com/speed/webp

@Necklaces
Copy link
Contributor

It's not a workaround, Viewnior uses GDK Pixbuf to load images. GDK Pixbuf requires loaders (in this case webp-pixbuf-loader) to load certain images.

@Lonniebiz
Copy link

Until Viewnior can view webp images (in the same way it views jpg, png, and gif) this issue should remain open (GDK Pixbuf needs to know that downstream projects have open tickets that depend on them).

@omentic
Copy link

omentic commented Apr 5, 2021

It's not Viewnior's problem. Dependencies are handled by your package manager.

If you'd like to let upstream know, take it to here: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/103

@minemax-ua
Copy link

It definitely should start supporting .webp images out of the box.

@Rava77
Copy link

Rava77 commented Nov 4, 2021

Like @Necklaces wrote: Viewnior uses GDK Pixbuf to load images. When the system is set up to support webp via GDK Pixbuf then viewnior supports webp just like it supports jpeg or png.
There are tutorials out there how to get the system to support webp - not only will viewnior then support webp, the file browser (e.g. thunar in XFCE) also will support webp as in: it will create the file icon preview images for all webp files.
If you want changes in that, ask the people who maintain your flavour of Linux to have it support webp out of the box via GDK Pixbuf. That is not a job for Viewnior to do when viewnior is set up to load and save any kind of image formats via GDK Pixbuf.

@minemax-ua
Copy link

minemax-ua commented Nov 4, 2021

Like @Necklaces wrote: Viewnior uses GDK Pixbuf to load images. When the system is set up to support webp via GDK Pixbuf then viewnior supports webp just like it supports jpeg or png. There are tutorials out there how to get the system to support webp - not only will viewnior then support webp, the file browser (e.g. thunar in XFCE) also will support webp as in: it will create the file icon preview images for all webp files. If you want changes in that, ask the people who maintain your flavour of Linux to have it support webp out of the box via GDK Pixbuf. That is not a job for Viewnior to do when viewnior is set up to load and save any kind of image formats via GDK Pixbuf.

To be fair, I'm not interested in all these technical details. I know that I've installed feh (which was quite a small package, by the way) and it shows webp no problem. That's what I expect from great software like Viewnior.

@Rava77
Copy link

Rava77 commented Nov 4, 2021

@minemax-ua My viewnior also supports webp after I added the system webp support via GDK Pixbuf . No need to change anything in viewnior itself.
Would you demand viewnior handles jpeg and png and gif as if it was not supported by the GDK Pixbuf system as well? Viewnior only supports these image formats because the system supports them via GDK Pixbuf . When you demand viewnior should bring its own support for webp, you either demand it brings the system support with it (even when the system already has webp support), or you demand the way viewnior handles all images (supporting all image formats supported by systemwide GDK Pixbuf ) to change to handle all that no longer via GDK Pixbuf but to program that from scratch then you demand they create a whole new program just so that people do not need to get the systemwide support for webp.

I am quite sure the developers of viewnior have better things to do than basically re-write the whole way viewnior handles images.

Like I already wrote: if you want changes, demand them from the people who setup and maintain your flavour of Linux, it is up to them to get the system ready for webp via GDK Pixbuf, that is not the job of the viewnior developers.

@fuckgithubanyway
Copy link

On Ubuntu 22 you can try the following:

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

install the library:
sudo apt install webp-pixbuf-loader

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests