Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 裁剪后的图像在本机中非常小_Android_Ios_Image_React Native_Image Processing - Fatal编程技术网

Android 裁剪后的图像在本机中非常小

Android 裁剪后的图像在本机中非常小,android,ios,image,react-native,image-processing,Android,Ios,Image,React Native,Image Processing,我想裁剪我的图像,我使用了@react native community/image editor 我想从base64图像中裁剪图像,所以我也使用了RNFetchBlob。这是我的密码 const file_path = RNFetchBlob.fs.dirs.DocumentDir + '/' + new Date().getTime() + '.jpg'; RNFetchBlob.fs .writeFile(file_path, this.state.image, '

我想裁剪我的图像,我使用了
@react native community/image editor
我想从base64图像中裁剪图像,所以我也使用了RNFetchBlob。这是我的密码

const file_path =
      RNFetchBlob.fs.dirs.DocumentDir + '/' + new Date().getTime() + '.jpg';
RNFetchBlob.fs
      .writeFile(file_path, this.state.image, 'base64')
      .then(res => {
        console.log(res);
        ImageEditor.cropImage(
          'file:///' + file_path,
          {
            offset: {x: topX, y: topY},
            size: {width: bottomX - topX, height: bottomY - topY},
            displaySize: {width: bottomX - topX, height: bottomY - topY},
          },
          'PNG',
        ).then(url => {
          console.log(url);
          this.setState({visible: true, cropedImage: url});
        });
      });
它在安卓系统上运行,但在iOS系统中,它非常小,比如20*20像素,即使我将其大小设置为1000像素以上。 我应该上传裁剪图像到服务器,所以我需要裁剪图像的文件。
谢谢您的回答。

问题是我将resizeMode设置为'center',将其更改为'contain',这就解决了我的问题