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

Lost animation when converting from GIF to WebP #606

Open
NiJeTi opened this issue Jul 31, 2021 · 2 comments
Open

Lost animation when converting from GIF to WebP #606

NiJeTi opened this issue Jul 31, 2021 · 2 comments

Comments

@NiJeTi
Copy link

NiJeTi commented Jul 31, 2021

Using library to reduce incoming images size. Converting incoming GIFs to WebP removes animation.

Used code:

public async Task<MemoryStream> ConvertStreamAsync(Stream input, CancellationToken cancellationToken)
{
    Log.Debug("Converting image stream");

    using var imagesProcessor = new ImageJob();
    var output = new MemoryStream();

    await imagesProcessor
       .Decode(input, false)
       .EncodeToStream(output, false, new WebPLosslessEncoder())
       .Finish()
       .WithCancellationToken(cancellationToken)
       .InProcessAsync();

    output.Position = 0;

    Log.Debug("Done converting image stream");

    return output;
}

input stream can contain JPEG, PNG, WebP and GIF

@NiJeTi
Copy link
Author

NiJeTi commented Jul 31, 2021

It also increased in size
image

@lilith
Copy link
Member

lilith commented May 1, 2022

I'm not sure we support animated WebP at this time, but I will see what I can do.

@lilith lilith transferred this issue from imazen/imageflow-dotnet Aug 5, 2022
@lilith lilith added this to the v2 milestone Aug 5, 2022
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

2 participants