Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. selectImage = () => {
  2. const options = {
  3. title: 'Select Image',
  4. storageOptions: {
  5. skipBackup: true,
  6. path: 'images',
  7. },
  8. };
  9. ImagePicker.showImagePicker(options, (response) => {
  10. console.log('Response = ', response);
  11.  
  12. if (response.didCancel) {
  13. console.log('User cancelled image picker');
  14. } else if (response.error) {
  15. console.log('ImagePicker Error: ', response.error);
  16. } else if (response.customButton) {
  17. console.log('User tapped custom button: ', response.customButton);
  18. } else {
  19. const source = { uri: response.uri };
  20. this.setState({
  21. image: source,
  22. predictions: null
  23. });
  24. this.classifyImage()
  25. }
  26. });
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement