Add callback call in the resizer function. #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank the team first as this library is useful in one of my project.
But when using it, I encountered one problem, when using in expressjs, which is when the user upload a fake picture (like after changing the ext of another non-pic file) and the server try to make a thumbnail of it, there will be an exception (unkown MIME type) in the jimp which will cause the resizer function to throw out the exception. But in expressjs, I cannot catch the exception which will cause the process terminate.
I am not sure whether I could find a better solution in expressjs side, but for now I just folk this project and add the callback in resizer function so that I can process the exception in the expressjs.
It will be appreciated if someone can provide a better solution without changing this lib!