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