.
This commit is contained in:
@@ -134,21 +134,6 @@
|
|||||||
|
|
||||||
el = evt.target;
|
el = evt.target;
|
||||||
|
|
||||||
$(el).find(".temp-thumb").remove();
|
|
||||||
if (el.files.length > 0) {
|
|
||||||
extra_class = " image-ident-loading";
|
|
||||||
if ($(el).hasClass("image-ident-warning")) {
|
|
||||||
extra_class = " image-ident-warning";
|
|
||||||
} else if ($(el).hasClass("image-ident-ok")) {
|
|
||||||
extra_class = " image-ident-ok";
|
|
||||||
}
|
|
||||||
n = el.id.split("-")[1];
|
|
||||||
$(`#drop-filenames span[data-input-id='${el.id}']`).remove();
|
|
||||||
$("#drop-filenames").append(
|
|
||||||
`<span data-input-id='${el.id}'><span>${n}: ${el.files[0].name}</span><img class='uploading${extra_class}' data-input-id='${el.id}' src=${URL.createObjectURL(el.files[0])}></span>`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//readFileAndProcess();
|
//readFileAndProcess();
|
||||||
readFileAndProcess2(el);
|
readFileAndProcess2(el);
|
||||||
@@ -471,20 +456,38 @@
|
|||||||
//await readFile(el.files[0], el);
|
//await readFile(el.files[0], el);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log(el.files[0])
|
console.log(el.files[0])
|
||||||
|
|
||||||
$(el).parent().parent().find(".temp-thumb").remove();
|
$(el).parent().parent().find(".temp-thumb").remove();
|
||||||
|
|
||||||
|
let url = URL.createObjectURL(el.files[0])
|
||||||
|
|
||||||
|
extra_class = " image-ident-loading";
|
||||||
|
if ($(el).hasClass("image-ident-warning")) {
|
||||||
|
extra_class = " image-ident-warning";
|
||||||
|
} else if ($(el).hasClass("image-ident-ok")) {
|
||||||
|
extra_class = " image-ident-ok";
|
||||||
|
}
|
||||||
|
n = el.id.split("-")[1];
|
||||||
|
$(`#drop-filenames span[data-input-id='${el.id}']`).remove();
|
||||||
|
|
||||||
let imageId;
|
let imageId;
|
||||||
if (el.files[0].type.startsWith("image")) {
|
if (el.files[0].type.startsWith("image")) {
|
||||||
base = await blobToBase64(el.files[0]);
|
base = await blobToBase64(el.files[0]);
|
||||||
imageId = "base64://" + base.split(",")[1];
|
imageId = "base64://" + base.split(",")[1];
|
||||||
imageId2 = base;
|
imageId2 = base;
|
||||||
|
const element = $(`<img class='temp-thumb' src=${url}></div>`).get(0)
|
||||||
|
$(el).parent().parent().prepend(element);
|
||||||
|
|
||||||
|
$("#drop-filenames").append(
|
||||||
|
`<span data-input-id='${el.id}'><span>${n}: ${el.files[0].name}</span><div class='uploading${extra_class}' data-input-id='${el.id}' src=${url}></div></span>`
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
let url = URL.createObjectURL(el.files[0])
|
|
||||||
imageId = `wadouri:${url}`;
|
imageId = `wadouri:${url}`;
|
||||||
imageId2 = imageId
|
imageId2 = imageId
|
||||||
}
|
|
||||||
console.log(imageId)
|
console.log(imageId)
|
||||||
const element = $(`<div class='temp-thumb' src=${imageId2}></div>`).get(0)
|
const element = $(`<div class='temp-thumb' src=${imageId2}></div>`).get(0)
|
||||||
$(el).parent().parent().prepend(element);
|
$(el).parent().parent().prepend(element);
|
||||||
@@ -495,6 +498,18 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const element2 = $(`#drop-filenames div[data-input-id='${el.id}']`).get(0);
|
||||||
|
cornerstone.enable(element2);
|
||||||
|
cornerstone.loadAndCacheImage(imageId).then(function (image) {
|
||||||
|
cornerstone.displayImage(element2, image);
|
||||||
|
cornerstone.resize(element2)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
active_file_inputs.delete(el)
|
active_file_inputs.delete(el)
|
||||||
console.log("active", active_file_inputs)
|
console.log("active", active_file_inputs)
|
||||||
|
|||||||
Reference in New Issue
Block a user