);
        console.log(quad);
        perspectiveViewer.setQuadSelection(quad);
      }

      async function loadImage(img,src) {
        return new Promise((resolve, reject) => {
          img.onload = function(){
            resolve();
          }
          img.src = src;
        })
      }
      
      function loadImageFromFile(){
        let fileInput = document.getElementById("file");
        let files = fileInput.files;
        if (files.length == 0) {
          return;
        }
        let file = 