1

我想如果我需要使用react-native-image-picker上传的图像有任何大小限制。因为当我尝试上传大小为 33MB 的 jpg 图像时,应用程序崩溃并显示“appName 已停止工作”。但与此同时,我可以上传 1MB 以上的扩展图片 png、jpeg、jpg 等,它工作正常。

  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);
    }

看,当我尝试上传那个大文件时,我没有得到任何回应。但这在 iOS 的情况下工作正常。

4

1 回答 1

2

所以基本上,在上传大图像时,库正在获取大量数据以转换为 base64。因此,该应用程序似乎正在崩溃。在设置nodata: true. 该库停止将数据转换为 base 64 并且工作正常。

于 2019-09-03T06:34:16.943 回答