mirror of
https://github.com/upscayl/upscayl.git
synced 2026-04-03 03:00:13 -04:00
Refactor code and remove config vars to fix ASCII path decoding
This commit is contained in:
@@ -40,12 +40,6 @@ export function setRememberOutputFolder(value: boolean): void {
|
||||
logit("💾 Updating Remember Output Folder: ", rememberOutputFolder);
|
||||
}
|
||||
|
||||
export let savedCompression = 0;
|
||||
export function setCompression(value: number): void {
|
||||
savedCompression = value;
|
||||
logit("📐 Updating Compression: ", savedCompression);
|
||||
}
|
||||
|
||||
export let stopped = false;
|
||||
export let childProcesses: {
|
||||
process: ChildProcessWithoutNullStreams;
|
||||
@@ -148,14 +142,7 @@ export function fetchLocalStorage(): void {
|
||||
setRememberOutputFolder(lastSaveOutputFolder);
|
||||
}
|
||||
});
|
||||
// GET IMAGE COMPRESSION (NUMBER) FROM LOCAL STORAGE
|
||||
mainWindow.webContents
|
||||
.executeJavaScript('localStorage.getItem("compression");', true)
|
||||
.then((lastSavedCompression: string | null) => {
|
||||
if (lastSavedCompression !== null) {
|
||||
setCompression(parseInt(lastSavedCompression));
|
||||
}
|
||||
});
|
||||
|
||||
// GET PROCESS IMAGE (BOOLEAN) FROM LOCAL STORAGE
|
||||
mainWindow.webContents
|
||||
.executeJavaScript('localStorage.getItem("noImageProcessing");', true)
|
||||
|
||||
@@ -5,7 +5,7 @@ const slash: string = getPlatform() === "win" ? "\\" : "/";
|
||||
|
||||
export const getSingleImageArguments = ({
|
||||
inputDir,
|
||||
fullfileName,
|
||||
fileNameWithExt,
|
||||
outFile,
|
||||
modelsPath,
|
||||
model,
|
||||
@@ -15,7 +15,7 @@ export const getSingleImageArguments = ({
|
||||
customWidth,
|
||||
}: {
|
||||
inputDir: string;
|
||||
fullfileName: string;
|
||||
fileNameWithExt: string;
|
||||
outFile: string;
|
||||
modelsPath: string;
|
||||
model: string;
|
||||
@@ -29,7 +29,7 @@ export const getSingleImageArguments = ({
|
||||
return [
|
||||
// INPUT IMAGE
|
||||
"-i",
|
||||
inputDir + slash + fullfileName,
|
||||
inputDir + slash + fileNameWithExt,
|
||||
// OUTPUT IMAGE
|
||||
"-o",
|
||||
outFile,
|
||||
@@ -109,6 +109,7 @@ export const getDoubleUpscaleSecondPassArguments = ({
|
||||
saveImageAs: ImageFormat;
|
||||
scale: string;
|
||||
customWidth: string;
|
||||
compression: string;
|
||||
}) => {
|
||||
const modelScale = (parseInt(getModelScale(model)) ** 2).toString();
|
||||
let includeScale = modelScale !== scale && !customWidth;
|
||||
|
||||
Reference in New Issue
Block a user