简体   繁体   中英

How to compress an image to be small?

I would like to know how to compress an image from size 5 mb to just over 200kb using React Native.

I have not tried any form yet, because I did not find anything of the type.

You can use the library react-native-image-crop-picker and combine it to redux

for example :

ImagePicker.openPicker({
  width: 300, // set your values
  height: 400,
  cropping: true //if you want enable to crop or not
}).then(image => {
  console.log(image);
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM