Skip to content

πŸ†™ Upscayl - #1 Free and Open Source AI Image Upscaler for Linux, MacOS and Windows.

Fix macos build and image issue

Nayam Amarshe80cb58b06c48
diff --git a/electron/commands/image-upscayl.ts b/electron/commands/image-upscayl.ts
index 624d62a..6a07e18 100644
--- a/electron/commands/image-upscayl.ts
+++ b/electron/commands/image-upscayl.ts
@@ -103,7 +103,7 @@ const imageUpscayl = async (event, payload) => {
getSingleImageArguments(
inputDir,
fullfileName,
- outFile,
+ outFile.slice(0, -3) + "png",
isDefaultModel ? modelsPath : customModelsFolderPath ?? modelsPath,
model,
initialScale,
@@ -164,16 +164,19 @@ const imageUpscayl = async (event, payload) => {
try {
await convertAndScale(
inputDir + slash + fullfileName,
- outFile,
+ outFile.slice(0, -3) + "png",
outFile,
desiredScale,
saveImageAs,
onError
);
// Remove the png file (default) if the saveImageAs is not png
- if (saveImageAs !== "png") {
- fs.unlinkSync(outFile.slice(0, -3) + "png");
- }
+ fs.access(outFile.slice(0, -3) + "png", fs.constants.F_OK, (err) => {
+ if (!err && saveImageAs !== "png") {
+ logit("πŸ—‘ Removing png file");
+ fs.unlinkSync(outFile.slice(0, -3) + "png");
+ }
+ });
mainWindow.setProgressBar(-1);
mainWindow.webContents.send(
COMMAND.UPSCAYL_DONE,
diff --git a/electron/index.ts b/electron/index.ts
index 032ad2b..1227964 100644
--- a/electron/index.ts
+++ b/electron/index.ts
@@ -49,6 +49,9 @@ app.on("window-all-closed", () => {
app.quit();
});
+// ! ENABLE THIS FOR MACOS APP STORE BUILD
+app.commandLine.appendSwitch("in-process-gpu");
+
ipcMain.on(COMMAND.STOP, stop);
ipcMain.on(COMMAND.OPEN_FOLDER, openFolder);
diff --git a/package.json b/package.json
index fdb81e8..d8128b8 100644
--- a/package.json
+++ b/package.json
@@ -101,7 +101,6 @@
"type": "distribution",
"category": "public.app-category.photography",
"entitlements": "resources/entitlements.mas.plist",
- "entitlementsInherit": "resources/entitlements.mas.inherit.plist",
"provisioningProfile": "embedded.provisionprofile",
"mergeASARs": false,
"icon": "build/icon.icns",
diff --git a/renderer/components/settings-tab/index.tsx b/renderer/components/settings-tab/index.tsx
index 5186909..452477f 100644
--- a/renderer/components/settings-tab/index.tsx
+++ b/renderer/components/settings-tab/index.tsx
@@ -190,7 +190,7 @@ function SettingsTab({
target="_blank">
Read Wiki Guide
</a>
- {FLAGS.APP_STORE_BUILD && <DonateButton />}
+ {!FLAGS.APP_STORE_BUILD && <DonateButton />}
</div>
<LogArea