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

[webp]animated webp image became static after processing #2521

Closed
4 tasks done
marshafan opened this issue Aug 29, 2023 · 1 comment · Fixed by #2569
Closed
4 tasks done

[webp]animated webp image became static after processing #2521

marshafan opened this issue Aug 29, 2023 · 1 comment · Fixed by #2569

Comments

@marshafan
Copy link

marshafan commented Aug 29, 2023

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

3.0.1

Other ImageSharp packages and versions

SixLabors.ImageSharp.Drawing(1.0.0)

Environment (Operating system, version and so on)

Win10 22H2

.NET Framework version

.NET 6

Description

mathiasbynens.be/demo/animated-webp-supported.webp cannot load animated webp images or save one correctly. Maybe the method I used is wrong.
Really appreciate for your work~

Steps to Reproduce

1.download the example image
2.load with code

           using (var imgStream = new MemoryStream())
           {
               await Request.Body.CopyToAsync(imgStream);
               if (imgStream == null || imgStream.Length == 0)
               {
                   return Fail("image can not be null");
               }
              var  buffer = new byte[imgStream.Length];
               imgStream.Position = 0;
               await imgStream.ReadAsync(buffer, 0, buffer.Length);
               //using(Image img=Image.Load(file))  //At first i wrote this line which turned out img.Frames.Count=1
               using (Image img = Image.Load(new DecoderOptions { MaxFrames = 100 }, file))//this way turned out img.Frames.Count=12
               {
                           var filePath= AppContext.BaseDirectory + Guid.NewGuid().ToString() + ".webp";
                           await img.SaveAsync(filePath);
               }
           }

Images

68747470733a2f2f6d61746869617362796e656e732e62652f64656d6f2f616e696d617465642d776562702d737570706f727465642e77656270.zip

@brianpopow
Copy link
Collaborator

@marshafan we do not support encoded animated webp yet. That is the last missing feature for webp. See: Missing features webp

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

Successfully merging a pull request may close this issue.

2 participants