react-native-image-resizer
react-native-image-resizer copied to clipboard
Output path seems to be ignored, image still lands in cached dir's
I may well have the syntax wrong here but at moment for iOS tests, this lib fails (doesn't crash, but also doesn't provide a resized image) if we specify a specific output path. We want to do this so we can move the image out of the '../../cache/..' dir and into the Documents folder on iOS.
here is our code:
ImageResizer
.createResizedImage(source.uri, 50, 50, 'PNG', 80, 0, `${dirs.DocumentDir}/ourImages` )
.then((resizedImageUri) => {
this.setState({
imageUri: resizedImageUri
});
}).catch((err) => {
console.log('error resizing image', err);
});
if we make the same call, but without the last 2 params, ie like this:
ImageResizer
.createResizedImage(source.uri, 50, 50, 'PNG', 80 )
then we get a resized image in the caches directory folder structure.
Are we doing something wrong in terms of the required parameter syntax ? Can you provide a working example if so ? Many thanks.