1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 12:13:43 +01:00

Fix macos build and image issue

This commit is contained in:
Nayam Amarshe 2023-10-15 15:07:04 +05:30
parent 788d7c7bd7
commit 80cb58b06c
4 changed files with 12 additions and 7 deletions

View File

@ -103,7 +103,7 @@ const imageUpscayl = async (event, payload) => {
getSingleImageArguments( getSingleImageArguments(
inputDir, inputDir,
fullfileName, fullfileName,
outFile, outFile.slice(0, -3) + "png",
isDefaultModel ? modelsPath : customModelsFolderPath ?? modelsPath, isDefaultModel ? modelsPath : customModelsFolderPath ?? modelsPath,
model, model,
initialScale, initialScale,
@ -164,16 +164,19 @@ const imageUpscayl = async (event, payload) => {
try { try {
await convertAndScale( await convertAndScale(
inputDir + slash + fullfileName, inputDir + slash + fullfileName,
outFile, outFile.slice(0, -3) + "png",
outFile, outFile,
desiredScale, desiredScale,
saveImageAs, saveImageAs,
onError onError
); );
// Remove the png file (default) if the saveImageAs is not png // Remove the png file (default) if the saveImageAs is not png
if (saveImageAs !== "png") { fs.access(outFile.slice(0, -3) + "png", fs.constants.F_OK, (err) => {
fs.unlinkSync(outFile.slice(0, -3) + "png"); if (!err && saveImageAs !== "png") {
} logit("🗑 Removing png file");
fs.unlinkSync(outFile.slice(0, -3) + "png");
}
});
mainWindow.setProgressBar(-1); mainWindow.setProgressBar(-1);
mainWindow.webContents.send( mainWindow.webContents.send(
COMMAND.UPSCAYL_DONE, COMMAND.UPSCAYL_DONE,

View File

@ -49,6 +49,9 @@ app.on("window-all-closed", () => {
app.quit(); app.quit();
}); });
// ! ENABLE THIS FOR MACOS APP STORE BUILD
app.commandLine.appendSwitch("in-process-gpu");
ipcMain.on(COMMAND.STOP, stop); ipcMain.on(COMMAND.STOP, stop);
ipcMain.on(COMMAND.OPEN_FOLDER, openFolder); ipcMain.on(COMMAND.OPEN_FOLDER, openFolder);

View File

@ -101,7 +101,6 @@
"type": "distribution", "type": "distribution",
"category": "public.app-category.photography", "category": "public.app-category.photography",
"entitlements": "resources/entitlements.mas.plist", "entitlements": "resources/entitlements.mas.plist",
"entitlementsInherit": "resources/entitlements.mas.inherit.plist",
"provisioningProfile": "embedded.provisionprofile", "provisioningProfile": "embedded.provisionprofile",
"mergeASARs": false, "mergeASARs": false,
"icon": "build/icon.icns", "icon": "build/icon.icns",

View File

@ -190,7 +190,7 @@ function SettingsTab({
target="_blank"> target="_blank">
Read Wiki Guide Read Wiki Guide
</a> </a>
{FLAGS.APP_STORE_BUILD && <DonateButton />} {!FLAGS.APP_STORE_BUILD && <DonateButton />}
</div> </div>
<LogArea <LogArea