在react native项目里,使用ios设备运行项目(iphone 14pro),并用takePictureAsync进行拍摄照片,同时使用createResizedImage对相片进行尺寸处理,想让图片变成宽为640,高480的尺寸,结果出来的照片尺寸为宽640,高453,请问这是因为什么?我要怎么做才能得到我想要的尺寸?
const image = RNCameraRef.current.takePictureAsync({
quality:1,
fixOrientation: true,
forceUpOrientation: true,
orientation: 3,
exif: true,
width:640,
}),
const resizedImageUrl = await ImageResizer.createResizedImage(
image .uri,
640,
480,
'JPEG',
85,
0,
undefined,
true,
);
得到的 resizedImageUrl 复制到本地查看后,图片尺寸是 640*453, 但是使用android手机图片尺寸正常,没有问题