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

how to initialise outputPath ?

Open alainib opened this issue 8 years ago • 1 comments

I used the exemple in the demo and want to save the resized file I'm new to mobile developpement. what to put in the "outputPath" ?

resize() {
let outputPath = "./media/external/images/media/"; //the uri is "content://media/external/images/media/229801"  .i tried a lot of path but all wrong
ImageResizer.createResizedImage(this.state.image.uri, 800, 600, "JPEG", 80,0 ,outputPath)
.then(resizedImageUri => {
    this.setState({
      resizedImageUri
    });
    Alert.alert("image resized");
  })
  .catch(err => {
    console.log(err);
    return Alert.alert(
      "Unable to resize the photo",
      "Check the console for full the error message"
    );
  });

}

alainib avatar Jun 16 '17 12:06 alainib

outputPath should be the prefixe in IOS , not full absolute path or it will concat two times

 "file:///var/mobile/Containers/Data/Application/A41B595C-E652-4D2D-861C-D4939E288B07/Documents/var/mobile/Containers/Data/Application/A41B595C-E652-4D2D-861C-D4939E288B07/Documents/MyAPPFolder/4E11BC89-83AB-40EA-8288-F2E9AEF9463D.jpg"

alainib avatar Mar 20 '19 12:03 alainib

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 01 '22 19:09 stale[bot]

This issue has been automatically closed. Thank you for your contributions.

stale[bot] avatar Sep 09 '22 03:09 stale[bot]