browser-image-resizer icon indicating copy to clipboard operation
browser-image-resizer copied to clipboard

Should reject readAndCompressImage's promise when reader or img encounter error

Open jasonkit opened this issue 5 years ago • 6 comments

Right now, if someone feed in a corrupted image file, readAndCompressImage's promise will never finish.

jasonkit avatar Aug 20 '20 23:08 jasonkit

Thanks for the contribution @jasonkit -- I did a recent refactor which also addresses this -- if you have a chance, can you re-test with v2.2.0 and lmk if it behaves as expected? Thanks!

ericnograles avatar Mar 21 '21 19:03 ericnograles

@ericnograles No, it still not working, I think you need to add onerror to img and reader in readAndCompressImage and call reject there as well. (you can refer to my PR: https://github.com/ericnograles/browser-image-resizer/pull/29/files)

jasonkit avatar Mar 23 '21 04:03 jasonkit

Ah I see. Let me get those changes in this week and I'll send to you for review if that's ok?

ericnograles avatar Mar 23 '21 11:03 ericnograles

@jasonkit merged master into your branch and reinstated your changes -- pushed to PR #29, can you review when you get a minute? Just wanna make sure you get credit for this PR in GitHub.

ericnograles avatar Mar 23 '21 11:03 ericnograles

@ericnograles can you comment on why #29 was never merged? These cases still fail silently and never resolve.

AdamStone avatar Oct 13 '21 19:10 AdamStone

@AdamStone oops, that was a miss. Will merge and cut a new release in the next day or so.

ericnograles avatar Oct 13 '21 19:10 ericnograles