0

I want to if there is any size restriction for the image I needed to upload using react-native-image-picker. Because when I try to upload an jpg image having size 33MB, the app crashes showing "appName has stopped working". But at the same time I'm able to upload images of extensions png,jpeg,jpg etc of size 1MB+ it's working fine.

  ImagePicker.launchImageLibrary(options, response => {
    console.log("oooooooooo", response);
    if (response.didCancel) {
      this.refs.toast.show(Strings.string_image_cancelled);
    } else (response.error) {
      console.log("ImagePicker Error: ", response.error);
    }

See, here I'm not getting any response from when I try to upload that large file. But this is working fine in case of iOS.

Vinay N
  • 249
  • 1
  • 8
  • 32

1 Answers1

2

So basically, while uploading a big image the library was getting a huge amount of data to be converted to base64. Thus the app seems to be crashing. On setting the nodata: true. The library stopped converting the data to base 64 and it worked fine.