捕获图像时,它会保存两张图像,一张是原始图像,另一张是压缩图像,并给出压缩图像的路径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