How does WeChat Mini Programs change the temporary path of uploading photos into the base64 format of photos?

fff: function () {
    var that = this;
    const ctx = wx.createCanvasContext("myCanvas")
    wx.chooseImage({
      success: function (res) {
        ctx.drawImage(res.tempFilePaths[0], 0, 0, 150, 100)
        ctx.draw(false, () => {
         wx.canvasGetImageData({
            canvasId: "myCanvas",
            x: 0,
            y: 0,
            width: 100,
            height: 100,
            success(res) {
              console.log(res.width) // 100
              console.log(res.height) // 100
              console.log(res.data instanceof Uint8ClampedArray) // true
              console.log(res.data) // 100 * 100 * 4
              let base64 = wx.arrayBufferToBase64(res.data);
              //console.log(base64)
              that.data.userImageBase64 = "data:image/jpg;base64," + base64;
              console.log(that.data.userImageBase64)
            }
          })
        })
           }
    })
  },

the background of Mini Program"s development is shown in the figure

but this last big code can not convert the correct picture, ask for God"s guidance.

Have you solved the problem of

?


good luck

if you only suggest binary upload for uploading pictures, save volume

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3864b-2c11b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3864b-2c11b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?