react-native - ImagePicker EXPO 长宽比
问题描述
早上好!我想问一些事情,我正在锻炼中,当我使用 Expo 的 ImagePicker 时,为什么当我选择一些图像时,我总是得到纵横比 [4,4]?即使我只是删除了纵横比参数
这是代码:
const pickImage = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.All,
// aspect: [4, 4],
quality: 1,
});
console.log(result);
if (!result.cancelled) {
const manipResult = await ImageManipulator.manipulateAsync(
result.uri,
[{ resize: { width: result.height / 4, height: result.width / 4 } }],
{ compress: 1, format: ImageManipulator.SaveFormat.JPEG }
);
console.log("MANIP: " + JSON.stringify(manipResult.uri));
uploadFoto(manipResult.uri);
}
};
original aspect
那张图片/图像是,18:9
那为什么我得到那个纵横比?请有人帮忙:(
解决方案
推荐阅读
- bash - linux终端smtp登录
- c# - 如何在asp.net core的中间件中修改httpcontext中的request/response?
- docker - 带有进程的 CMD 命令中的 Docker ARG
- python - 从 python 3.7 更改为 python 3.8 时出错
- java - 在 onViewCreated 与 onCreate 中的 Fragment 中获取 ViewModel
- javascript - 将 React 元素传递给库
- arrays - 基于数组索引的字符串查询的Elasticsearch数组
- html - 页面加载到第二个域的框架中
- ios - 无法实现 AVPictureInPictureController - tvOS 14.0+
- python - 在python优化中使用拉格朗日方法时如何获取lamda值