【发布时间】:2020-02-17 12:24:45
【问题描述】:
当图像被捕获时,它会保存两张图像,一张是原始的,另一张是压缩的,并在image.path 中给出压缩图像的路径。如何禁用在图库中保存任何图像,我只需要使用 base64 即可?
ImagePicker.openCamera({
cropping: true,
width: 300*3,
height: 400*3,
includeBase64: true,
mediaType:'photo',
}).then(image => {
console.log('received image');
console.log(image)
})
输出如下:
cropRect: {height: 4128, width: 3096, y: 0, x: 0}
data: "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQ"
height: 900
mime: "image/jpeg"
modificationDate: "1581938243000"
path: "file:///storage/emulated/0/Pictures/398da0f6-73ee-47ce-bfdd-8b0fa68312a5.jpg"
size: 353210
width: 675
【问题讨论】:
-
设法解决?我有同样的问题
-
你找到解决这个问题的方法了吗?
标签: react-native react-native-fs react-native-image-picker