dfa1234 / ngx-image-compress

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

Issue using with Ionic: I get black images from camera and gallery #84

Open ionic2022 opened 2 years ago

ionic2022 commented 2 years ago

I'm using this plugin for compression in an ionic project, and whenever I upload images from the camera or gallery, I get black images. I used the ionic camera plugin for the camera and gallery. Please assist or guide me in resolving this matter as soon as possible.

dfa1234 commented 2 years ago

please try without ionic plugin Just use the function uploadImage and it should do the work

if you need to use ionic plugin absolutly, you need to pass into compressImage a proper data url, it's a string basically, encoded in base 64. Use console log to see what ionic plugin is returning and modify the string accordinly.

If this comment helped you please copy paste your code here so other could see how our library is working with ionic. I know this is working, because at the beginning this library was meant to be use with ionic plugin only.

please check with https://image-compress.app

arslanali143 commented 7 months ago

Facing same issue. But I am directly using compress file method. Issue happening after upgrade to Angular 14 to 16 & Browser Upgrade from Firefox 78 to 119