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

Issue with Cropping Animated Gifs #652

Open
caviyacht opened this issue Sep 3, 2024 · 4 comments
Open

Issue with Cropping Animated Gifs #652

caviyacht opened this issue Sep 3, 2024 · 4 comments

Comments

@caviyacht
Copy link

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:

43612_right--output-imageflow

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:

43612_right

@lilith
Copy link
Member

lilith commented Sep 4, 2024 via email

@caviyacht
Copy link
Author

@lilith , is this something that seems plausible to put in? We are currently using the legacy version of this image resizer (which exhibits the same issue) and are considering moving to the newer version. I don't know what ImageSharp (would rather not) is doing, but it doesn't seem to exhibit this issue, perhaps they're looking at the first frame.

@lilith
Copy link
Member

lilith commented Sep 4, 2024

I'll put it on the list. If you have a support contract, we can prioritize it, but you're the first to report the issue since those features were added in 2010.

@lilith
Copy link
Member

lilith commented Nov 15, 2024

Can you release that image into the public domain for use in our test suites?

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

No branches or pull requests

2 participants