react-native-image-resizer icon indicating copy to clipboard operation
react-native-image-resizer copied to clipboard

Output path seems to be ignored, image still lands in cached dir's

Open ajonno opened this issue 8 years ago • 0 comments

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.

ajonno avatar Apr 17 '17 06:04 ajonno