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

Pass decoder options to the underlying decoder when reading from files and buffers, not just URLs #1357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DefiantCatgirl
Copy link

What's Changing and Why

This should fix #1356

This ensures that decoder options are passed regardless of where Jimp reads an image from. Right now, the options are only passed if Jimp reads an image from a URL, but not when it reads it from a file or from a buffer.

Without this, it is sometimes impossible to read large JPEG files (~8k resolution) from files or buffers, as reading a large JPEG can fail with a memory allocation error unless a high enough maxMemoryUsageInMB value is passed to the js-jpeg decoder (by default its memory usage is limited to only 512 MB).

What else might be affected

Hopefully nothing.

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

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

Successfully merging this pull request may close these issues.

Decoder options are not passed to the underlying decoder when using Jimp.read() for buffers or files
1 participant