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

Resizing animated gifs result in Image too large error #69

Open
marcduiker opened this issue Dec 24, 2024 · 1 comment
Open

Resizing animated gifs result in Image too large error #69

marcduiker opened this issue Dec 24, 2024 · 1 comment

Comments

@marcduiker
Copy link

I finally figured out what went wrong with the resizing of images in my fork.

Currently, the resizing process doesn't handle large (many frames) animated gifs well when it also includes jpg as an output format. Each frame of the gif is vertically stacked into the jpg output, making it too large to handle.

Temporary solution: For now, I've limited the output types to only use webp to avoid the unnecessary stacked jpg output. The sharpOptions include animated to enable animated webp output, and I've set the limitInputPixels to be 100x larger than the default option, but this really depends on the size & length of the gif animations.

Suggested solutions:

  1. Don't use jpg output at all for animated file types, even when this is included in the output formats.
  2. Use conditional output formats per input file type: still image -> ['webp', 'jpg'], animated image -> ['webp', 'gif']

I hope this provides enough context for you. Perhaps the solution needs to be somewhere upstream instead of this template.

@madrilene
Copy link
Owner

Thank you Marc!

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