收藏
回答

调用微信图片端口为什么图片总被压缩成640px的图片?

调用腾讯端口,为什么图片总是被压缩为640px的尺寸图片,怎么回事?

我的部分代码,但是并不起作用,而且640px也不是我代码里的数值????

wx.getImageInfo({

      src: filePath,

      success: (res) => {

        if (res.width > 1080 && res.height > 1080) {

          if (res.width > res.height) {

            wx.compressImage({

              src: filePath,

              quality: 80,

              compressedHeight: 1080,

              success: (res2) => {

                imgFilePath = res2.tempFilePath

                wx.getFileInfo({

                  filePath: res2.tempFilePath,

                  success: (res3) => {

                    imgFileSize = res3.size

                    resolve({ imgFilePath, imgFileSize })

                  },

                })

              },

            })


回答关注问题邀请回答
收藏

2 个回答

  • 阳光里
    阳光里
    03-19

    我的代码里有约束,但一直被压缩

    03-19
    有用
    回复
  • 智能回答 智能回答 该问答由AI生成
    03-19
    有用
登录 后发表内容