Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploadAndGetImageWithMaxSize and uploadAndGetImageWithMaxSizeAndMetas always rejected (noticeable in the stackblitz demo, even if the resultant image is smaller than the set 1MB limit) #115

Open
nik2208 opened this issue Sep 26, 2024 · 1 comment

Comments

@nik2208
Copy link

nik2208 commented Sep 26, 2024

well... I think I've been too extensive in the title..

@JaimeReynoso
Copy link

Hey so one thing i did to get around this is
const MAX_MEGABYTE = 2; this.imageCompress.uploadFile().then((val) => { let byteCount = this.imageCompress.byteCount(val.image) console.log('here') if(byteCount > (MAX_MEGABYTE *1024*1024)) { this.imageCompress.getImageWithMaxSizeAndMetas(val, MAX_MEGABYTE).then(val =>this.Upload(val), (rejected)=> this.Reject(rejected)) } else{ this.Upload((val)) } }, (rejected)=> this.Reject(rejected))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants