ngx-image-compress icon indicating copy to clipboard operation
ngx-image-compress copied to clipboard

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

Open nik2208 opened this issue 1 year ago • 1 comments

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

nik2208 avatar Sep 26 '24 14:09 nik2208

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))

JaimeReynoso avatar Nov 29 '24 20:11 JaimeReynoso