overtrue/vue-avatar-cropper

Corrupted files break the component

ferretwithaberet opened this issue · 1 comments

Description
When a corrupted image file is uploaded, the component breaks and gives some errors.

Proposed fix
Listen for the error event on the <img> element, if the image element fails to load the image, then handle the error.

Here is an example of a corrupted image file.

corruptedFile.zip