【发布时间】:2018-02-21 12:58:12
【问题描述】:
IOS 11 上的新 .HEIC 文件会导致问题,因为图像托管服务不支持它。
相机胶卷 API 正在返回 .HEIC 文件。我们怎样才能得到 .JPG/.PNG 代替。或将 .HEIC 转换为 .JPG/.PNG
【问题讨论】:
-
也许您可以为此使用转换器?
标签: reactjs react-native ios11 camera-roll
IOS 11 上的新 .HEIC 文件会导致问题,因为图像托管服务不支持它。
相机胶卷 API 正在返回 .HEIC 文件。我们怎样才能得到 .JPG/.PNG 代替。或将 .HEIC 转换为 .JPG/.PNG
【问题讨论】:
标签: reactjs react-native ios11 camera-roll
ImagePicker.showImagePicker(options, imgResponse => {
this.setState({ imageLoading: true, avatarMediaId: null });
if ((imgResponse.didCancel) || (imgResponse.error)) {
this.setState({ imageLoading: false });
} else {
let source = {};
let fileName = imgResponse.fileName;
if (Platform.OS === 'ios' && (fileName.endsWith('.heic') || fileName.endsWith('.HEIC'))) {
fileName = `${fileName.split(".")[0]}.JPG`;
}
source = { uri: imgResponse.uri, fileName };
this.uploadImage(source);
}});
【讨论】: