overtrue / vue-avatar-cropper

:girl: A simple and elegant avatar cropping and upload plugin.

Home Page:https://github.com/overtrue/vue-avatar-cropper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Corrupted files break the component

ferretwithaberet opened this issue · 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