1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 04:03:51 +01:00

Merge pull request #288 from upscayl/progress-bar

added progress bar
This commit is contained in:
Suvojit Ghosh 2023-04-26 21:12:38 +05:30 committed by GitHub
commit 249afd385c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -490,6 +490,9 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
const onData = (data: string) => {
logit("image upscayl: ", data.toString());
mainWindow.setProgressBar(parseFloat(data.slice(0, data.length)) / 100);
data = data.toString();
mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, data.toString());
if (data.includes("invalid gpu") || data.includes("failed")) {
@ -508,6 +511,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
const onClose = () => {
if (failed !== true) {
logit("Done upscaling");
mainWindow.setProgressBar(-1);
mainWindow.webContents.send(
commands.UPSCAYL_DONE,
isAlpha ? outFile + ".png" : outFile