Skip to content

Support for animated webp images #92

Answered by saucecontrol
mortb asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like you're using the Windows built-in WebP codec, which doesn't support animation. There is a new plugin for MagicScaler that does support animated WebP decoding and encoding https://www.nuget.org/packages/PhotoSauce.NativeCodecs.Libwebp

With that, your sample works fine.

using System.Diagnostics;
using PhotoSauce.MagicScaler;
using PhotoSauce.NativeCodecs.Libwebp;

CodecManager.Configure(codecs => {
    codecs.UseLibwebp();
});

var http = new HttpClient();
using var resp = await http.GetAsync("https://mathiasbynens.be/demo/animated-webp-supported.webp");
using var stream = await resp.Content.ReadAsStreamAsync();

using var ms = new MemoryStream();
stream.CopyTo(ms);
ms.Position = 0;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mortb
Comment options

Answer selected by mortb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #91 on September 05, 2022 18:14.