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

When load an animated webp image throws "SixLabors.ImageSharp.ImageFormatException: Unexpected chunk followed VP8X header" exception. #2154

Closed
4 tasks done
Hellobaka opened this issue Jun 16, 2022 · 5 comments

Comments

@Hellobaka
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

ImageSharp version

2.1.2

Other ImageSharp packages and versions

SixLabors.ImageSharp.Drawing 1.0.0-beta14; Sixlabors.Fonts 1.0.0-beta17

Environment (Operating system, version and so on)

Win10 21H2

.NET Framework version

.net 5.0.402

Description

https://mathiasbynens.be/demo/animated-webp-supported.webp

I have seen the feature support PR, but I still cannot load animated webp images. Maybe the method I used is wrong.

Steps to Reproduce

  1. download the example image
  2. load with code
Image img = Image.Load(@"1.webp");

then exception throws.

Unhandled exception. SixLabors.ImageSharp.ImageFormatException: Unexpected chunk followed VP8X header
   at SixLabors.ImageSharp.Formats.Webp.WebpThrowHelper.ThrowImageFormatException(String errorMessage)
   at SixLabors.ImageSharp.Formats.Webp.WebpDecoderCore.ReadVp8XHeader()
   at SixLabors.ImageSharp.Formats.Webp.WebpDecoderCore.ReadVp8Info()
   at SixLabors.ImageSharp.Formats.Webp.WebpDecoderCore.Decode[TPixel](BufferedReadStream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream, Func`3
largeImageExceptionFactory, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream, Cancell
ationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Webp.WebpDecoder.Decode[TPixel](Configuration configuration, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Webp.WebpDecoder.Decode(Configuration configuration, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Image.Decode(Stream stream, Configuration config, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Image.<>c__DisplayClass134_0.<Load>b__0(Stream s)
   at SixLabors.ImageSharp.Image.WithSeekableStream[T](Configuration configuration, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Load(Configuration configuration, Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Load(Configuration configuration, String path, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Load(Configuration configuration, String path)
   at SixLabors.ImageSharp.Image.Load(String path)
   at BilibiliMonitor.Program.Main(String[] args) in E:\编程\程序c#\BilibiliMonitor\BilibiliMonitor\Program.cs:line 19

Images

test img

@brianpopow
Copy link
Collaborator

Decoding animated webp images is not supported in 2.1.2, but the error message is wrong though. The expected error message should have been NotSupportedException, but the ANIM chunk is not recognized as an optional VP8X chunk.

The error does not occur in main. Decoding animated webp images was added recently with #1985. For missing webp features see #1802.

You can try our nightly build to verify that.

@Hellobaka
Copy link
Author

Decoding animated webp images is not supported in 2.1.2, but the error message is wrong though. The expected error message should have been NotSupportedException, but the ANIM chunk is not recognized as an optional VP8X chunk.

The error does not occur in main. Decoding animated webp images was added recently with #1985. For missing webp features see #1802.

You can try our nightly build to verify that.

Thank you. I tried the nightly build and the program successfully loaded the animated webp image. Hope this feature be added to stable branch soon. Thanks for all your work.

JimBobSquarePants added a commit that referenced this issue Jun 17, 2022
@marshafan
Copy link

i came into a different problem,as i uploaded the animated webp image above using 3.0.1(Sixlabor.ImageSharp.dll),and finally called saveAsync ,it produced a static webp which had just one frame.
By debugging,it showed that the Image instance as a result of Image.Load(byte[]),had a Frames property eqauled to 1.
What might be the reason?thank you for your answer^_^

@JimBobSquarePants
Copy link
Member

i came into a different problem,as i uploaded the animated webp image above using 3.0.1(Sixlabor.ImageSharp.dll),and finally called saveAsync ,it produced a static webp which had just one frame.

Then why did you comment on this closed issue?

@marshafan
Copy link

i came into a different problem,as i uploaded the animated webp image above using 3.0.1(Sixlabor.ImageSharp.dll),and finally called saveAsync ,it produced a static webp which had just one frame.

Then why did you comment on this closed issue?

sorry,i should create a new one..

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

4 participants