我正在使用反应原生图像选择器和图像缩放器来挑选然后调整图像大小.调整大小后,如何获取图像的base64? ImagePickerManager.showImagePicker(imagepicker_options, (response) = { ImageResizer.createResizedIm
ImagePickerManager.showImagePicker(imagepicker_options, (response) => { ImageResizer.createResizedImage(response.uri, 550, null, 'JPEG', 100).then((resizedImageUri) => { //get base64 of image }); });https://libraries.io/npm/react-native-asset-library-to-base64
ImagePickerManager.showImagePicker(imagepicker_options, (response) => { ImageResizer.createResizedImage(response.uri, 550, null, 'JPEG', 100).then((resizedImageUri) => { //get base64 of image, uri is link to asset-library:// ReadImageData.readImage(uri, (imageBase64) => { console.log(imageBase64); }); }); });
如果你没有https://github.com/facebook/react-native/issues/1158,你可能也想读这个