dfa1234 / ngx-image-compress

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

just compress and resize if width bigger than a given value #85

Closed giammin closed 2 years ago

giammin commented 2 years ago

I'm trying to achieve to just compress and resize if width bigger than a given value

something like:

const compressed = await this.imageResizerService.compressFile(
        blobInfo.blobUri(), DOC_ORIENTATION.Default,100, 80,this.config.maxWidth);

the compressed file is always bigger (filesize) than original file, is it normal?

dfa1234 commented 2 years ago

@giammin it's totally normal because you are using '100' in quality parameter. If you don't decrease the quality even a little, it's very likely to happen