dfa1234 / ngx-image-compress

Angular library for uploading and compressing images
https://image-library.app
MIT License
86 stars 37 forks source link

I got the RangeError when I choose 0 size file #71

Closed fluttercid closed 2 years ago

fluttercid commented 2 years ago

Hello, First of all, I appreciate your implementing this. When I choose 0 size file on a selection dialog for the image, I got the RangeError as below. image Do you have any idea about it? Thank you for your answer in advance.

dfa1234 commented 2 years ago

Thank a lot to report some bug.

But I didn't succeed to reproduce.

What do you mean "When I choose 0 size file on a selection dialog for the image"?

Feel free to fork our repo on stackblitz, save it, and and submit it here. I will take you just a couple of second.

dfa1234 commented 2 years ago

@fluttercid I finally figured what you mean.

Indeed if you try to upload a totally empty file of 0 bytes, it will throws this error.

Thank for finding this interesting edge case 👍