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

Can't load saved WEBP file #29

Closed
Beelink opened this issue Mar 22, 2021 · 0 comments
Closed

Can't load saved WEBP file #29

Beelink opened this issue Mar 22, 2021 · 0 comments

Comments

@Beelink
Copy link

Beelink commented Mar 22, 2021

I am getting this error when trying to load a saved WEBP file:

Exception thrown: 'System.Exception' in quick-picture-viewer.exe
Failed WebPGetFeatures with error VP8_STATUS_BITSTREAM_ERROR
In WebP.Decode

This code I am using to open the JPG image:

Bitmap bmp = new Bitmap(path);

This code I am using to save the WEBP image:

using (WebP webp = new WebP()) webp.Save(bmp, path);

This code I am using to load the WEBP image:

byte[] rawWebP = File.ReadAllBytes(path);
using (WebP webp = new WebP())
{
	WebPDecoderOptions decoderOptions = new WebPDecoderOptions();
	decoderOptions.use_threads = 1;
	decoderOptions.alpha_dithering_strength = 100;
	Bitmap bmp = webp.Decode(rawWebP, decoderOptions); // error here
}

This image that I am trying to save and load: image.zip

P.S.
Looks like Windows Explorer is rendering the thumbnail of the saved WEBP file correctly so I think there are no issues with the saving function:

image

@Beelink Beelink closed this as completed May 3, 2021
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

1 participant