Fix large pixel image rendition issue by adding limitInputPixels option
Issue #, if available: https://github.com/aws-solutions/serverless-image-handler/issues/465
Description of changes: Implement limitInputPixels option which is now supported by sharp library. This will enable us to process very large images . Any image larger than 16364 * 16364 need limitInputPixels set to false.
Checklist
- [x] :wave: I have added unit tests for all code changes.
- [x] :wave: I have run the unit tests, and all unit tests have passed.
- [ ] :warning: This pull request might incur a breaking change.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Hi @dougtoppin , Could you please add yourself as a reviewer and review the PR. I'm unable to add reviewers. Thanks!
@dougtoppin I have updated the PR . See my comments below:
would be good to npm run prettier-format in source to ensure that the code meets formatting guidelines
don't leave in commented out code in resize.spec.ts. - DONE
rather than change an existing unit test, it would be better to add new unit tests for expected to pass and expected to fail behavior confirmation - DONE
another consideration is to provide the same functionality and unit tests for the thumbor style requests - I can work on it in next version
for PRs that are not very large, it is worthwhile to squash the commits into a single commit, this helps make it clear in the history as to what changed and why - DONE
for PRs that provide new capabilities and/or are configurable, please include descriptive text that can be folded into the Implementation guide as to what it is and how to use it, note that related to this is a mention that using potentially larger images may mean that the default Lambda sizing be increased to accommodate additional memory needs - Let me know how you want to document this
@dougtoppin Any luck with this PR review?
Hi @madhubalaji,
I've added a task to the backlog to evaluate and potentially include this change in the next minor release.
Thanks for your patience on this, Simon
Hi @madhubalaji, I've gone ahead and implemented this change internally, you should see the functionality added in the next minor/major release. While we can see the feature being useful, we've decided not to include it on default deployments, rather, an Env variable that is passed to the Backend Lambda function will need to be modified. Any number value in this EnvVar will be passed directly to Sharp (0 = infinite), while any non-number value (including an empty string) will use the existing default.
Due to our internal processes, you won't see this PR get merged, rather, once this change is released, this PR will be closed and you'll find your name and a link to the PR included at the bottom of the README.
Thank you for your contributions to SIH. Simon