1

I just installed the package and I'm trying to access the picture, although I'm getting a directory without the image.

Dependencies

"react-native": "0.61.5",
"react-native-camera": "^3.22.0",

My Code

takePicture = async () => {
  if (this.camera) {
    const options = {quality: 0.5, base64: true};
    const data = await this.camera.takePictureAsync(options);
    console.log(data.uri);
  }
};

Output file:///data/user/0/*******/cache/Camera but the file is missing

"deviceOrientation": 1, "height": 3456, "pictureOrientation": 1, "uri": "file:///data/user/0/***/cache/Camera", "width": 4608}
j3ff
  • 5,719
  • 8
  • 38
  • 51
Openwell
  • 336
  • 1
  • 3
  • 9
  • If you log out the data object, does it have any of the relevant attributes like base64 or weight/height data about the photo? – Tom Finney Apr 09 '20 at 14:26
  • @TomFinney Yes ...it also logs base64... which is too long to display here – Openwell Apr 09 '20 at 14:30
  • That's weird that is it has the image attributes but valid direct direct path... sorry I can't help with that. Not too familiar with RN Camera – Tom Finney Apr 09 '20 at 14:43

1 Answers1

1

https://github.com/react-native-community/react-native-camera/releases/tag/v3.22.1

The issue was fixed by the creator. 18hours ago.. which I didn't know.

Openwell
  • 336
  • 1
  • 3
  • 9