1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-30 18:24:27 +01:00

Updated outputPath

This commit is contained in:
Nayam Amarshe 2023-04-28 18:20:54 +05:30
parent d4b776ea23
commit ee526ed8dd

View File

@ -319,6 +319,10 @@ ipcMain.on(commands.DOUBLE_UPSCAYL, async (event, payload) => {
const model = payload.model as string; const model = payload.model as string;
let inputDir = (payload.imagePath.match(/(.*)[\/\\]/)[1] || "") as string; let inputDir = (payload.imagePath.match(/(.*)[\/\\]/)[1] || "") as string;
let outputDir = payload.outputPath as string; let outputDir = payload.outputPath as string;
if (saveOutputFolder === true && outputFolderPath) {
outputDir = outputFolderPath;
}
const gpuId = payload.gpuId as string; const gpuId = payload.gpuId as string;
const saveImageAs = payload.saveImageAs as string; const saveImageAs = payload.saveImageAs as string;
const scale = payload.scale as string; const scale = payload.scale as string;
@ -456,6 +460,10 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
let inputDir = (payload.imagePath.match(/(.*)[\/\\]/)[1] || "") as string; let inputDir = (payload.imagePath.match(/(.*)[\/\\]/)[1] || "") as string;
let outputDir = folderPath || (payload.outputPath as string); let outputDir = folderPath || (payload.outputPath as string);
if (saveOutputFolder === true && outputFolderPath) {
outputDir = outputFolderPath;
}
const isDefaultModel = defaultModels.includes(model); const isDefaultModel = defaultModels.includes(model);
// COPY IMAGE TO TMP FOLDER // COPY IMAGE TO TMP FOLDER
@ -547,6 +555,10 @@ ipcMain.on(commands.FOLDER_UPSCAYL, async (event, payload) => {
// GET THE OUTPUT DIRECTORY // GET THE OUTPUT DIRECTORY
let outputDir = payload.outputPath; let outputDir = payload.outputPath;
if (saveOutputFolder === true && outputFolderPath) {
outputDir = outputFolderPath;
}
if (!fs.existsSync(outputDir)) { if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true }); fs.mkdirSync(outputDir, { recursive: true });
} }