From c7ec54fb5bf19da3b722de4e3101e46422c4d13b Mon Sep 17 00:00:00 2001 From: Feenix <25067102+NayamAmarshe@users.noreply.github.com> Date: Sat, 29 Apr 2023 22:42:40 +0530 Subject: [PATCH] Updated stop button and warning --- renderer/components/ProgressBar.tsx | 4 +++- renderer/pages/index.tsx | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/renderer/components/ProgressBar.tsx b/renderer/components/ProgressBar.tsx index 5b52a93..f4c2248 100644 --- a/renderer/components/ProgressBar.tsx +++ b/renderer/components/ProgressBar.tsx @@ -14,7 +14,9 @@ function ProgressBar({ progress, doubleUpscaylCounter, stopHandler }) {
Doing the Upscayl magic...
- + ); diff --git a/renderer/pages/index.tsx b/renderer/pages/index.tsx index d022327..6780211 100644 --- a/renderer/pages/index.tsx +++ b/renderer/pages/index.tsx @@ -82,12 +82,12 @@ const Home = () => { data.includes("encode") ? "ENCODING ERROR => " : "DECODING ERROR => " + - "This image is possibly corrupt or not supported by Upscayl. You could try converting the image into another format and upscaling again. Otherwise, make sure that the output path is correct and you have the proper write permissions for the directory. If not, then unfortuantely this image is not supported by Upscayl, sorry." + "This image is possibly corrupt or not supported by Upscayl, or your GPU drivers are acting funny (Did you check if your GPU is compatible and drivers are alright?). You could try converting the image into another format and upscaling again. Also make sure that the output path is correct and you have the proper write permissions for the directory. If not, then unfortuantely there's not much we can do to help, sorry." ); resetImagePaths(); } else if (data.includes("uncaughtException")) { alert( - "Upscayl encountered an error. Possibly, the upscayl binary failed to execute the commands properly. Try launching Upscayl using commandline through Terminal and see if you get any information. You can post an issue on Upscayl's GitHub repository for more help." + "Upscayl encountered an error. Possibly, the upscayl binary failed to execute the commands properly. Try checking the logs to see if you get any information. You can post an issue on Upscayl's GitHub repository for more help." ); resetImagePaths(); } @@ -142,7 +142,7 @@ const Home = () => { if (progress === "") return; setProgress(""); setUpscaledImagePath(data); - console.log("upscaledImagePath: ", upscaledImagePath) + console.log("upscaledImagePath: ", upscaledImagePath); addToLog(data); }); @@ -479,12 +479,15 @@ const Home = () => { const stopHandler = () => { window.electron.send(commands.STOP); resetImagePaths(); - } + }; const formatPath = (path) => { //USE REGEX TO GET THE FILENAME AND ENCODE IT INTO PROPER FORM IN ORDER TO AVOID ERRORS DUE TO SPECIAL CHARACTERS - return path.replace(/([^/\\]+)$/i, encodeURIComponent(path.match(/[^/\\]+$/i)[0])) - } + return path.replace( + /([^/\\]+)$/i, + encodeURIComponent(path.match(/[^/\\]+$/i)[0]) + ); + }; const allowedFileTypes = ["png", "jpg", "jpeg", "webp"]; const allowedVideoFileTypes = ["webm", "mp4", "mkv"]; @@ -625,7 +628,11 @@ const Home = () => { { setDimensions({