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

How is limitInputPixels applied to GIFs? #3421

Closed
travisofthenorth opened this issue Oct 28, 2022 · 4 comments
Closed

How is limitInputPixels applied to GIFs? #3421

travisofthenorth opened this issue Oct 28, 2022 · 4 comments
Labels

Comments

@travisofthenorth
Copy link

Question about an existing feature

What does limitInputPixels mean in the context of an animated GIF?

What are you trying to achieve?

I am seeing Error: Input image exceeds pixel limit for an animated GIF with dimensions 1024x768. The GIF is very long though...the file size is almost 200MB.

I want to understand how this logic is applied to GIFs so I can raise/lower it appropriately.

When you searched for similar issues, what did you find that might be related?

I saw this issue, but I think they were just dealing with images.

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question

N/A

Please provide sample image(s) that help explain this question

N/A

@lovell
Copy link
Owner

lovell commented Nov 1, 2022

The limitInputPixels value is for the combination of all frames, rather than an individual frame size, so you should be able to multiply your required frame size limit by required frame count limit to get a suitable overall limit.

@travisofthenorth
Copy link
Author

@lovell thanks for the response. So using the example above, a GIF of dimensions 1024x768 has a frame size of 786432 pixels. Taking the default value of limitInputPixels of 268402689, that results in a limit of 341 frames. Is that correct?

@lovell
Copy link
Owner

lovell commented Nov 1, 2022

Yes, that sounds about right. This feature is to help protect against untrusted input that could quickly consume memory. If you trust the input, the limit can be removed entirely with limitInputPixels: false.

@travisofthenorth
Copy link
Author

@lovell thanks again! This is really helpful.

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

No branches or pull requests

2 participants