Taking a picture with storageOptions.path has no effect
See original GitHub issueI am trying to take a picture with the camera providing storageOptions like this:
const options = {
cameraType: 'back',
mediaType: 'photo',
storageOptions: {
cameraRoll: false, // Don't save photos to the camera roll
path: "/data/data/com.testapp/itemfiles"
skipBackup: true, // No need to backup to iClould
},
};
ImagePicker.launchCamera(options, (response) => {
if (response.didCancel) {
console.log('User cancelled image picker');
}
else if (response.error) {
console.log('ImagePicker Error: ', response.error);
}
else if (response.customButton) {
console.log('User tapped custom button: ', response.customButton);
}
else {
let source = {uri: response.uri};
}
});
Pretty standard stuff, I suppose. The problem I’m having is that the options don’t seem to have any effect The path doesn’t change and the file is saved in the camera roll instead. I have confirmed that the path does exist.
The URI in the response looks like this:
uri: ‘content://com.reportit.provider/app_images/Pictures/image-a3fbe51e-94d8-4564-855c-464ed0d8f0ff.jpg’,
The logs mention this as well:
W/unknown:InspectorPackagerConnection: Couldn’t connect to packager, will silently retry I/TAG: Finished scanning /storage/emulated/0/Pictures/image-5e89bc4d-0f11-4e83-bf37-5283ae39f425.jpg
What am I doing wrong? How can I save pictures to the path I specified?
Additional Information
- React Native version: 0.48.3
- Platform: Android (5.0.2 device and 7.0 emulator)
- Development Operating System: MacOS
- Dev tools: Android Studio, PhpStorm
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Taking a picture with storageOptions.path has no effect #731
I am trying to take a picture with the camera providing storageOptions like this: const options = { cameraType: 'back', mediaType: 'photo', ...
Read more >react-native-image-picker - persistent storage after rebuild
Here is my function that is called when I add an image. ImagePicker.showImagePicker({ storageOptions: { path: 'myCustomPath', waitUntilSaved: ...
Read more >10 Tips for Taking Better Smartphone Photos - TIME
Want to take better smartphone photos with your iPhone or Android? Give these suggestions from pro photographers a try.
Read more >react-native-image-picker - Let's see how to take a photo and ...
Option Required Type iOS Android
title X string ○ ○
cancelButtonTitle X string ○ ○
takePhotoButtonTitle X string ○ ○
Read more >Storage options - Compute Engine - Google Cloud
Snapshots are incremental, and take only minutes to create even if you snapshot disks that are attached to running instances. Restrictions. Regional PD...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve made a local change to MediaUtils.java:49:
Now I can pass a folder like this:
And the path in the response is
But cameraRoll: false is still ignored…
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.