react-native-wtfssd-imagecompress
v1.0.0
Published
图片压缩组件
Downloads
2
Readme
react-native-wtfssd-imagecompress
a react-native tool to compress image
install
npm install react-native-wtfssd-imagecompress --save
link
react-native link react-native-wtfssd-imagecompress
usage
import ImageCompress from 'react-native-wtfssd-imagecompress';
ImageCompress.compress(imageurl,size).then(response => {
console.log('success',response);
}).catch(e => {
console.log('error', e);
});
paramlist
imageUrl
the url of imagesize
expect size of compress (unit:kb)
response contained the follow fields
data
thebase64
stringfileName
the name of image(unit:B)size
the compressed size of imageorigin
the origin url of imageoriginSize
the size of origin image (unit:B)