From a6cf1564d8b90f9c7f00c741efc9805473057545 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Oct 2022 15:51:36 +0200 Subject: [PATCH] Fix issues on windows --- frontend/package.json.md5 | 2 +- frontend/src/App.svelte | 45 +++++++++++++++----------- frontend/src/lib/Button.svelte | 13 +++++++- frontend/src/lib/Header.svelte | 20 +++++------- frontend/src/lib/Pathconfig.svelte | 51 ++++++++++++++++++++++++++---- frontend/src/lib/Settings.svelte | 33 +++++++++++++++++-- go.mod | 8 ++--- go.sum | 16 +++++----- main.go | 14 ++++++-- 9 files changed, 144 insertions(+), 58 deletions(-) diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index d69931e..861cd4d 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -3369211da39dcc63e89750b11fced2dd \ No newline at end of file +af281d83f29a49c45820e690cc0ab6e8 \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index c192c63..e4bc1c0 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -8,15 +8,18 @@ import Loader from "./lib/Loader.svelte"; // CONSTANTS - const title = "WaterMarker"; - const version = "1.2"; + const version = "V1.3"; const author = "ICheered"; const authorLink = "https://icheered.nl"; // PARAMETERS - // let sourceFolderPath = "/home/tjbakker/Documents/dev/vscode/go/WaterMarker/testfiles/source"; + //let sourceFolderPath = "/home/tjbakker/Documents/dev/vscode/go/WaterMarker/testfiles/source"; // let targetFolderPath = "/home/tjbakker/Documents/dev/vscode/go/WaterMarker/testfiles/watermarked"; // let watermarkPath = "/home/tjbakker/Documents/dev/vscode/go/WaterMarker/testfiles/watermark.png"; + + // let sourceFolderPath = "C:\\Users\\TJBakker\\Documents\\WaterMarker\\testfiles\\vertical"; + // let targetFolderPath = "C:\\Users\\TJBakker\\Documents\\WaterMarker\\testfiles\\watermarked"; + // let watermarkPath = "C:\\Users\\TJBakker\\Documents\\WaterMarker\\testfiles\\fotociewm.png"; let sourceFolderPath = ""; let targetFolderPath = ""; @@ -37,30 +40,28 @@ let showLoader = false; + let showImagePreview = false; + // FUNCTIONS let mainbuttontext = ""; + let mainButtonDisabled = true; $: { if (sourceFolderPath == "" || targetFolderPath == "" || watermarkPath == "") { mainbuttontext = "Select source, target and watermark"; + mainButtonDisabled = true; } else if (numberOfSourceFiles == 0) { mainbuttontext = "No images found in source folder!"; + mainButtonDisabled = true; } else if (changedSettings) { mainbuttontext = "Generate preview"; + mainButtonDisabled = false; } else { mainbuttontext = "Start processing!"; + mainButtonDisabled = false; } } function generatePreview() { - // fetch("/home/tjbakker/Documents/dev/vscode/go/wails/testfiles/watermarked/DSC_0134.jpg") - // .then((response) => response.blob()) - // .then((blob) => { - // const reader = new FileReader(); - // reader.addEventListener("load", function () { - // watermarkedpreviewImage.setAttribute("src", reader.result); - // }); - // reader.readAsDataURL(blob); - // }); showLoader = true; console.log("Generating preview"); FetchPreview( @@ -78,6 +79,7 @@ fetch(fetchpath) .then((response) => response.blob()) .then((blob) => { + showImagePreview = true; const reader = new FileReader(); reader.addEventListener("load", function () { watermarkedpreviewImage.setAttribute("src", reader.result); @@ -133,7 +135,7 @@
Processing image
{/if} -
+
@@ -145,6 +147,8 @@ bind:numberOfSourceFiles bind:numberOfTargetFiles bind:watermarkpreviewImage + bind:changedSettings + bind:showImagePreview />
@@ -156,8 +160,12 @@
- Preview of the result -
@@ -190,13 +198,12 @@ width: 75%; height: 100%; } - .mainview img { - max-width: 95%; + .previewwindow { + height: 489.25px; border-radius: 20px; margin: 10px; box-shadow: 0px 0px 20px #4d5056; - /* width: 733.875px; */ - height: 489.25px; + text-align: center; } .settingscol { diff --git a/frontend/src/lib/Button.svelte b/frontend/src/lib/Button.svelte index 0abc935..7abbfd8 100644 --- a/frontend/src/lib/Button.svelte +++ b/frontend/src/lib/Button.svelte @@ -1,9 +1,10 @@
- +
diff --git a/frontend/src/lib/Header.svelte b/frontend/src/lib/Header.svelte index 1819d9e..9dd8508 100644 --- a/frontend/src/lib/Header.svelte +++ b/frontend/src/lib/Header.svelte @@ -1,33 +1,29 @@
-
- {title} +
+ Made by {author}
{version}
-
- {author} -
+
-
diff --git a/frontend/src/lib/Pathconfig.svelte b/frontend/src/lib/Pathconfig.svelte index 5a4a80d..24f7851 100644 --- a/frontend/src/lib/Pathconfig.svelte +++ b/frontend/src/lib/Pathconfig.svelte @@ -1,5 +1,9 @@