From 6a2e1f48f9c227e701d574787e1c16a97769e97c Mon Sep 17 00:00:00 2001 From: waltem01 Date: Fri, 16 Feb 2024 07:22:37 +0100 Subject: [PATCH] place image onto canvas --- Webserver/src/routes/image/+page.svelte | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index 0f28724..2a68d21 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -10,6 +10,13 @@ let imageURL: string | null, lastImage: File; let uploadData: UploadData; + async function placeImage() { + const fdata = new FormData(); + fdata.append('x', '0'); + fdata.append('y', '0'); + await post(fdata, 'image'); + } + async function sendImage(url: string) { const fdata = new FormData(); fdata.append('url', url); @@ -98,8 +105,13 @@

Sending image . . .

{uploadData.elapsed} seconds elapsed.

{:then} -

Done!

-

{uploadData.elapsed} seconds elapsed.

+ {#await placeImage()} +

Placing image . . .

+

{uploadData.elapsed} seconds elapsed.

+ {:then} +

Done!

+

{uploadData.elapsed} seconds elapsed.

+ {/await} {/await} {/await} {/if}