{"action":"created","issue":{"url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/254","repository_url":"https://api.github.com/repos/marcshilling/react-native-image-picker","labels_url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/254/labels{/name}","comments_url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/254/comments","events_url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/254/events","html_url":"https://github.com/marcshilling/react-native-image-picker/issues/254","id":163857266,"number":254,"title":"[Android] File size of 0 with Camera!","user":{"login":"zvat","id":20301519,"avatar_url":"https://avatars.githubusercontent.com/u/20301519?v=3","gravatar_id":"","url":"https://api.github.com/users/zvat","html_url":"https://github.com/zvat","followers_url":"https://api.github.com/users/zvat/followers","following_url":"https://api.github.com/users/zvat/following{/other_user}","gists_url":"https://api.github.com/users/zvat/gists{/gist_id}","starred_url":"https://api.github.com/users/zvat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvat/subscriptions","organizations_url":"https://api.github.com/users/zvat/orgs","repos_url":"https://api.github.com/users/zvat/repos","events_url":"https://api.github.com/users/zvat/events{/privacy}","received_events_url":"https://api.github.com/users/zvat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2016-07-05T13:58:06Z","updated_at":"2016-12-06T00:32:38Z","closed_at":null,"body":"Hallo,\ni don't anderstend. Your picker (^0.20.0) worked well on VW (Genomotion), but when i start app on Device (OnePlus One, CM13, Andriod 6.0.1) i can't to upload pictures from Camera. I found only one difference:\non vm: fileSize:6249\non device: fileSize:0\ni think this is the problem or not??\nmy options:\n`const options = {\n          storageOptions: {\n              skipBackup: true,\n              path: 'images'\n          },\n          allowsEditing: false\n      };`\n\nresponse on device:\n`fileName: \"image-81d70921-110b-44f6-8f46-056e2adbd5b4.jpg\", \nfileSize: 0, \npath: \"/storage/emulated/0/Pictures/image-81d70921-110b-44f6-8f46-056e2adbd5b4.jpg\", \ntype: \"image/jpeg\", \nuri: \"file:///storage/emulated/0/Pictures/image-81d70921-110b-44f6-8f46-056e2adbd5b4.jpg\"`\n"},"comment":{"url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/comments/265024097","html_url":"https://github.com/marcshilling/react-native-image-picker/issues/254#issuecomment-265024097","issue_url":"https://api.github.com/repos/marcshilling/react-native-image-picker/issues/254","id":265024097,"user":{"login":"jemise111","id":4265163,"avatar_url":"https://avatars.githubusercontent.com/u/4265163?v=3","gravatar_id":"","url":"https://api.github.com/users/jemise111","html_url":"https://github.com/jemise111","followers_url":"https://api.github.com/users/jemise111/followers","following_url":"https://api.github.com/users/jemise111/following{/other_user}","gists_url":"https://api.github.com/users/jemise111/gists{/gist_id}","starred_url":"https://api.github.com/users/jemise111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jemise111/subscriptions","organizations_url":"https://api.github.com/users/jemise111/orgs","repos_url":"https://api.github.com/users/jemise111/repos","events_url":"https://api.github.com/users/jemise111/events{/privacy}","received_events_url":"https://api.github.com/users/jemise111/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T00:32:38Z","updated_at":"2016-12-06T00:32:38Z","body":"@richsilv same problem I was seeing. The uri returned in the response does not actually contain anything for somewhere between 500ms and 10s.\r\n\r\nI'm not sure how to fix but I did find a (very hacky) workaround that may work for some people. Sadly it's all in JS:\r\n\r\nsomething like...\r\n\r\n```\r\nclass ImagePickerComponent extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.imageCheckInterval = null;\r\n    this.state = {imagePath: null};\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    if (!_.isUndefined(this.imageCheckInterval)) {\r\n      clearInterval(this.imageCheckInterval);\r\n    }\r\n  }\r\n\r\n  openImagePicker() {\r\n    ImagePicker.showImagePicker(options, (response) => {\r\n      \r\n      const CHECK_IMAGE_URI_INTERVAL_MS = 1000;\r\n\r\n      if (Platform.OS === 'ios') {\r\n        this.setState({imagePath: response.uri});\r\n      } else {\r\n        this.imageCheckInterval = setInterval( () => {\r\n          // Use getSize as a proxy for when the image exists\r\n          Image.getSize(\r\n            response.uri,\r\n            () => {\r\n              clearInterval(this.imageCheckInterval);\r\n              this.setState({imagePath: response.uri});\r\n            }\r\n          );\r\n        }, CHECK_IMAGE_URI_INTERVAL_MS);\r\n      }\r\n    });\r\n  }\r\n\r\n  render() {\r\n    if (this.state.imagePath) {\r\n      return <Image source={{uri: this.state.imagePath}} />\r\n    } else {\r\n      return <View style={styles.placeholder} />\r\n    }\r\n  }\r\n\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"jemise111"}}