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

Support for WebP is imperfect: Alpha, Lossless and Animation isn't supported #1550

Closed
fralonra opened this issue Sep 3, 2021 · 4 comments
Closed

Comments

@fralonra
Copy link

fralonra commented Sep 3, 2021

Hi, all.

I noticed that the support for WebP is not all done.
See

b"ALPH" | b"VP8L" | b"ANIM" | b"ANMF" => {

The comment below says: Alpha, Lossless and Animation isn't supported.

I dont know why not to support them and is there a plan to make them work?

@installgentoo
Copy link
Contributor

I had to do

			if let image::ImageFormat::WebP = fmt {
				// TODO CARGO.toml throw away libwebp_image when image gets colour info in webp
				Res(libwebp_image::webp_load(img.into_inner()))?
			} else {
				img.decode().map_err(|_| "Cannot decode image")?
			}

some time back. libwebp_image was created 3 years back, so i wouldn't expect first-class webp support any time soon.

@fintelia
Copy link
Contributor

The main issue here is that image doesn't like to depend on libraries not written in Rust. Since libwebp is written in C, we rely on a (currently incomplete) re-implementation of it in Rust. The changes in #1536 and #1549 will be included in the next release and do improve the situation, but there is still more left.

@installgentoo
Copy link
Contributor

@fintelia why does image state YES for webp support, when i still get
Cannot decode image: Unsupported(UnsupportedError { format: Exact(WebP), kind: GenericFeature("ALPH") })
?

@fintelia
Copy link
Contributor

This was fixed in #1685

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

No branches or pull requests

3 participants