Open
Description
I am currently trying to evaluate ImageFlow but am running into an issue when resizing animated gifs. When resizing the following image it ends up causing it to bounce around a bit. This doesn't happen in other libraries, but seems to be happening in ImageFlow and the legacy ImageResizer.
It seems like one of the frames with the lights is causing the image to be slightly bigger than the rest of the frames. Perhaps the bug is that the image size isn't taking into account the biggest image in the sequence?
Output:
using var job = new ImageJob();
// NOTE: Removing 'trim.threshold' does fix the issue, but then it doesn't trim
await job
.Decode(await File.ReadAllBytesAsync(source))
.ResizerCommands("width=400&bgcolor=white&trim.threshold=50")
.EncodeToStream(destinationFile.OpenWrite(), true, new GifEncoder())
.Finish().InProcessAsync();
Input file: