react-native-compressor icon indicating copy to clipboard operation
react-native-compressor copied to clipboard

Quality parameter doen't work

Open aaroncornelissen opened this issue 6 months ago • 1 comments

Current behavior

We compress images in our app. We use the maxWidth and the maxHeight combined with the quality. The images are getting compressed, so that is great. We're only experiencing that the quality parameter setting makes no difference. The compression result stays the same if we use 0.1 of 0.9.

 const compressedFileUri = await Image.compress(file.uri, {
      maxWidth: 2000,
      maxHeight: 2000,
      quality: 0.9,
      input: 'uri',
    });

Expected behavior

More compression when the quality is lower

Platform

  • [X] Android
  • [X] iOS

React Native Version

0.75.5 old arch

React Native Compressor Version

1.10.1 (also tested with 1.11.0

Reproducible Steps And Demo

  • Compress an image with the parameters from the description
  • Change the quality to a lower number
  • Compare both files, quality and size are equal

aaroncornelissen avatar May 07 '25 11:05 aaroncornelissen