收藏
回答

鸿蒙6.0系统wx.getImageInfo使用从snapshot截的图,直接走到了fail?

显示的是截图成功,不知道为什么getImageInfo会报错,安卓,ios是正常的,现在是还没支持鸿蒙系统吗,微信版本8.0.13

最后一次编辑于  2025-12-05
回答关注问题邀请回答
收藏

4 个回答

  • 社区技术运营专员--阳光
    社区技术运营专员--阳光
    2025-12-07

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2025-12-07
    有用
    回复 1
    • Pluto.
      Pluto.
      2025-12-12
      代码片段:
      const wx_pusher = wx.createLivePusherContext("wx_pusher")
      //推流成功,视频接通后 截图
      wx_pusher.snapshot({
        sourceType: 'view',
        complete:(e)=>{
          if (e.tempImagePath) {
            resolve(e)
            // 鸿蒙系统返回 {"errno":0,"tempImagePath":"wxfile://tmp_PkEgiO.jpg","width":xx,"height":xx}
            // 正常手机返回 {"errno":0,"tempImagePath":"wxfile://tmp_e0a2a504360f7bd7c53c8cfc383648e37d2863918a57aa32.jpg","width":xx,"height":xx}
               wx.getImageInfo({
             src: res.tempImagePath,
             success: async function (ress) {
                    // 鸿蒙系统返回
                   {"errMsg": "getlmagelnfo:fail:get image info failed"}
                   //正常手机返回
                   {width: 1080, orientation: "up", type: "jpeg", height: 2150, errMsg: "getImageInfo:ok", …}
               }})
         } else {
            reject(e)
          }
       }
      })
      2025-12-12
      回复
  • 夏天
    夏天
    01-14

    我也碰到了这个问题,这个现在有解决吗

    01-14
    有用
    回复
  • Pluto.
    Pluto.
    2025-12-09

    代码片段:

    const wx_pusher = wx.createLivePusherContext("wx_pusher")
    
    //推流成功,视频接通后 截图
    wx_pusher.snapshot({
      sourceType: 'view',
      complete:(e)=>{
        if (e.tempImagePath) {
          resolve(e) 
          // 鸿蒙系统返回                {"errno":0,"tempImagePath":"wxfile://tmp_PkEgiO.jpg","width":xx,"height":xx}
          // 正常手机返回    {"errno":0,"tempImagePath":"wxfile://tmp_e0a2a504360f7bd7c53c8cfc383648e37d2863918a57aa32.jpg","width":xx,"height":xx}
             wx.getImageInfo({
           src: res.tempImagePath,
           success: async function (ress) {
                  // 鸿蒙系统返回 
                 {"errMsg": "getlmagelnfo:fail:get image info failed"}
                 //正常手机返回
                 {width: 1080, orientation: "up", type: "jpeg", height: 2150, errMsg: "getImageInfo:ok", …}
             }})
          } else {
          reject(e)
        }
     }
    })
    


    2025-12-09
    有用
    回复
  • 智能回答 智能回答 本次回答由AI生成
    2025-12-05
    有用
登录 后发表内容