The picture uploaded by vue is incomplete.

clipboard.png

the foreground uses base64 encoding format, and this is what it looks like in the background database

upload code
compress (img) {

  let canvas = document.createElement("canvas");
  let ctx = canvas.getContext("2d");
  //canvas
  let tCanvas = document.createElement("canvas");
  let tctx = tCanvas.getContext("2d");
  let initSize = img.src.length;

  let width = img.width;
  let height = img.height;
  //400
  let ratio;
  if ((ratio = width * height / 4000000) > 1) {
    console.log("400");
    ratio = Math.sqrt(ratio);
    width /= ratio;
    height /= ratio;
  } else {
    ratio = 1;
  }
  canvas.width = width;
  canvas.height = height;
  //        
  ctx.fillStyle = "-sharpfff";
  ctx.fillRect(0, 0, canvas.width, canvas.height);
  //100
  let count;
  if ((count = width * height / 1000000) > 1) {
    console.log("100W");
    count = ~~(Math.sqrt(count) + 1); //
    //            
    let nw = ~~(width / count);
    let nh = ~~(height / count);
    tCanvas.width = nw;
    tCanvas.height = nh;
    for (let i = 0; i < count; iPP) {
      for (let j = 0; j < count; jPP) {
        tctx.drawImage(
          img,
          i * nw * ratio,
          j * nh * ratio,
          nw * ratio,
          nh * ratio,
          0,
          0,
          nw,
          nh
        );
        ctx.drawImage(tCanvas, i * nw, j * nh, nw, nh);
      }
    }
  } else {
    ctx.drawImage(img, 0, 0, width, height);
  }
  
  //
  let ndata = canvas.toDataURL("image/jpeg", 0.1);
  console.log(":" + initSize);
  console.log(":" + ndata.length);
  console.log(
    ":" + ~~(100 * (initSize - ndata.length) / initSize) + "%"
  );
  tCanvas.width = tCanvas.height = canvas.width = canvas.height = 0;
  console.log(ndata);
  return ndata;
}

},

Nov.07,2021
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-1e5d050-44f34.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-1e5d050-44f34.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?