首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >react本地相机胶卷.heic文件

react本地相机胶卷.heic文件
EN

Stack Overflow用户
提问于 2018-02-21 20:58:13
回答 1查看 683关注 0票数 5

IOS11上的新.HEIC文件会导致问题,因为镜像托管服务不支持它。

相机胶卷应用编程接口是returning.HEIC文件。我们如何才能得到.JPG/.PNG。或将.HEIC转换为.JPG/.PNG

EN

回答 1

Stack Overflow用户

发布于 2021-02-01 12:27:36

代码语言:javascript
复制
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);
}});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48906547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档