dfa1234 / ngx-image-compress

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

Invalid image #62

Closed byronigoe closed 2 years ago

byronigoe commented 2 years ago

Define the onerror event handler and reject the promise. This could happen if the image is invalid.

Fixes #60

byronigoe commented 2 years ago

@clau007 If you want to use this before it's merged, you can do so like this (from your project root):

cd ..
git clone -b invalid-image --single-branch https://github.com/byronigoe/ngx-image-compress.git
cd ngx-image-compress
npm install
ng build ngx-image-compress
cd dist/ngx-image-compress
sudo npm link
cd ../../../<your_project>
npm link ngx-image-compress
dfa1234 commented 2 years ago

I'm merging it right now.

Thank a lot @byronigoe nice find

dfa1234 commented 2 years ago

@byronigoe Sorry to not merge this directly as is. There was a lot of conflict after the last refactoring.