2015-11-29 19:58:58 +00:00
|
|
|
import React from 'react-native';
|
|
|
|
|
|
|
|
const ImageResizerAndroid = React.NativeModules.ImageResizerAndroid;
|
|
|
|
|
|
|
|
export default {
|
2016-06-30 17:07:42 +00:00
|
|
|
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,
|
2016-06-30 17:07:42 +00:00
|
|
|
compressFormat, quality, rotation, outputPath, resolve, reject);
|
2015-11-29 19:58:58 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|