Await image decode before addResource in upscaleAndDownload.
This commit is contained in:
parent
fba6d2331a
commit
90758e3762
1 changed files with 2 additions and 1 deletions
|
@ -1534,7 +1534,7 @@ async function upscaleAndDownload(
|
|||
body: JSON.stringify(data),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
.then(async (data) => {
|
||||
console.log(data);
|
||||
var link = document.createElement("a");
|
||||
link.download =
|
||||
|
@ -1554,6 +1554,7 @@ async function upscaleAndDownload(
|
|||
console.log("Add upscaled to resource");
|
||||
const img = new Image();
|
||||
img.src = link.href;
|
||||
await img.decode();
|
||||
tools.stamp.state.addResource(guid() + " (upscaled)", img);
|
||||
}
|
||||
if (download == true) {
|
||||
|
|
Loading…
Reference in a new issue