微信6.7.2版本 wx.getImageInfo(OBJECT) 问题
发布于 6 年前 作者 xuefang 12183 次浏览 来自 问答

 使用 wx.getImageInfo(OBJECT)接口,使用存储文件路径和相对路径在微信6.7.2版本被报错:errMsg:“getImageInfo:fail:file not not found”; 急救

5 回复

    var that = this;
    wx.getSystemInfo({
      success:function(res){
        var width = res.windowWidth
        wx.getImageInfo({
          src: “…/…/images/index.png”,
          success: function (res) {
            var height = res.height*width/res.width
            console.log(res);
            that.setData({
              width: width,
              height: height
            });
          },
          complete: function(res){
            console.log(res);
          }
        })
      }
    });

不同的机型和版本表现不同,有时可以,有时报错

你好 有解决方法吗

同遇到这个问题,很急,楼主解决了吗

麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题

回到顶部