选择图片,返回图片类型错误

发布于 7 年前作者 yong356052 次浏览最后编辑 7 年前来自 ask

选择GIF图片,返回类型错误


第一种方式

wx.chooseImage({

 success: function (res) {

   var tempFilePaths = res.tempFilePaths

    console.log(tempFilePaths[0].path);        //后缀jpg

 }

})

第二种方式

wx.chooseImage({

    success: function (res) {

        wx.getImageInfo({

      src: res.tempFilePaths[0],

     success: function (res){

          console.log(res.type)        //类型为jpeg

     }    })  } })


5 回复
yong59
yong591 楼6 年前

你好,目前暂不支持gif图片,后续会考虑支持上。

yfan
yfan2 楼6 年前

兄弟,你可以到uc浏览器中,下载一个gif图片,然后选择这个图片获取后缀。我发给你也是在电脑端啊

yangchang
yangchang3 楼6 年前

 对啊,但是我实际是gif图片,可是返回的类型是jpeg。这个问题在开发工具上是对的

chaoxiao
chaoxiao4 楼6 年前

gif图片提供一下?

yqiu
yqiu5 楼5 年前

开发工具中正常,手机中会出现这种情况