Merge pull request #294 from Metachs/main

Fix for issue #293
This commit is contained in:
tim h 2024-08-31 09:55:00 -05:00 committed by GitHub
commit c347fbde32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1534,7 +1534,7 @@ async function upscaleAndDownload(
body: JSON.stringify(data), body: JSON.stringify(data),
}) })
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then(async (data) => {
console.log(data); console.log(data);
var link = document.createElement("a"); var link = document.createElement("a");
link.download = link.download =
@ -1554,6 +1554,7 @@ async function upscaleAndDownload(
console.log("Add upscaled to resource"); console.log("Add upscaled to resource");
const img = new Image(); const img = new Image();
img.src = link.href; img.src = link.href;
await img.decode();
tools.stamp.state.addResource(guid() + " (upscaled)", img); tools.stamp.state.addResource(guid() + " (upscaled)", img);
} }
if (download == true) { if (download == true) {