react-native-image-resizer/index.android.js

13 lines
445 B
JavaScript
Raw Permalink Normal View History

2015-11-29 19:58:58 +00:00
import React from 'react-native';
const ImageResizerAndroid = React.NativeModules.ImageResizerAndroid;
export default {
createResizedImage: (imagePath, newWidth, newHeight, compressFormat, quality, rotation = 0, outputPath) => {
2015-11-29 19:58:58 +00:00
return new Promise((resolve, reject) => {
ImageResizerAndroid.createResizedImage(imagePath, newWidth, newHeight,
compressFormat, quality, rotation, outputPath, resolve, reject);
2015-11-29 19:58:58 +00:00
});
},
};