fix: make it work

This commit is contained in:
alban 2023-07-26 01:28:19 +02:00
parent a21ba6b8fb
commit 0e43bea656
11 changed files with 110 additions and 42 deletions

View file

@ -106,36 +106,15 @@ $(document).ready(function(){
img = new Image();
var objectUrl = _URL.createObjectURL(file);
img.onload = function () {
let w = 640
let h = 640 * this.height / this.width
showSnap(this,w,h)
let w = 640;
let h = 640 * this.height / this.width;
showSnap(this,w,h);
};
img.src = objectUrl;
}
if(files && typeof FileReader !== "undefined") {
for(var i=0; i<files.length; i++) {
// fileToSnap(files[i]);
}
}
}
var fileToSnap = function(file) {
if( (/image/i).test(file.type) ) {
var reader = new FileReader();
reader.onload = function(e) {
let base_image = new Image();
base_image.src = e.target.result;
console.log(
base_image.width
)
base_image.width = 640;
base_image.onload = function(){
showSnap(base_image,640,480)
}
};
reader.readAsDataURL(file);
}
}
// Draws every segment received, except black colored target ones
var drawSimu = function() {