1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-28 01:10:52 +01:00

added progress bar

This commit is contained in:
TGS963 2023-04-26 20:58:14 +05:30
parent 30d69c8a63
commit 53518927e2

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