diff --git a/main/binaries.js b/main/binaries.js index 3446d83..92c9e79 100644 --- a/main/binaries.js +++ b/main/binaries.js @@ -2,11 +2,13 @@ const path = require("path"); const { rootPath } = require("electron-root-path"); const { isPackaged } = require("electron-is-packaged"); const { getPlatform } = require("./getPlatform"); -const {app} = require('electron') const IS_PROD = process.env.NODE_ENV === "production"; -const binariesPath = path.join(app.getAppPath(), "../", getPlatform(), "./bin"); +const binariesPath = + IS_PROD && isPackaged // the path to a bundled electron app. + ? path.join(rootPath, "./Contents", "./Resources", "./bin") + : path.join(rootPath, "./resources", getPlatform(), "./bin"); const execPath = path.resolve(path.join(binariesPath, "./upscayl")); const modelsPath = path.resolve(path.join(binariesPath, "./models")); diff --git a/main/index.js b/main/index.js index a181c93..1c5e084 100644 --- a/main/index.js +++ b/main/index.js @@ -29,7 +29,7 @@ app.on("ready", async () => { mainWindow = new BrowserWindow({ width: 1100, - height: 850, + height: 700, minHeight: 500, minWidth: 500, webPreferences: { @@ -96,19 +96,11 @@ ipcMain.handle(commands.SELECT_FOLDER, async (event, message) => { }); ipcMain.on(commands.UPSCAYL, async (event, payload) => { - //console.log(execPath) - console.log(payload); const model = payload.model; const scale = payload.scaleFactor; - let inputDir = payload.imagePath.match(/(.*)[\/\\]/)[1] || ""; - /*if (!fs.existsSync(inputDir)) { - fs.mkdirSync(inputDir); - }*/ - let outputDir = payload.outputPath; - // if (!fs.existsSync(outputDir)) { - // fs.mkdirSync(outputDir); - // } + let inputDir = payload.imagePath.match(/(.*)[\/\\]/)[1] || ""; + let outputDir = payload.outputPath; // COPY IMAGE TO upscaled FOLDER const fullfileName = payload.imagePath.split("/").slice(-1)[0]; @@ -126,9 +118,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => { "-s", scale === 2 ? 4 : scale, "-m", - modelsPath, // if (!fs.existsSync(outputDir)) { - // fs.mkdirSync(outputDir); - // } + modelsPath, "-n", model, ], diff --git a/package.json b/package.json index 63f235b..c292e79 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,31 @@ { "name": "upscayl", "private": true, - "version": "1.0.3", + "version": "1.1.0", "productName": "Upscayl", - "author": "TGS963 ", - "email": "nay@am.com", + "contributors": [ + { + "name": "Nayam Amarshe", + "email": "nayam@amars.he", + "url": "https://github.com/NayamAmarshe" + }, + { + "name": "TGS963", + "email": "tgs@963.com", + "url": "https://github.com/TGS963" + } + ], "license": "GPLv2", - "description": "Upscayl - Linux first image upscale app", + "description": "Upscayl - Free and Open Source AI Image Upscaler", "keywords": [ + "AI", + "Upscaler", + "Image Upscale", + "Linux image upscale", + "Topaz Gigapixel", "Linux", - "Gnome", - "Desktop", - "Shortcut" + "KDE", + "Gnome" ], "main": "main/index.js", "scripts": { @@ -29,12 +43,16 @@ { "from": "constants", "to": "constants", - "filter": ["**/*"] + "filter": [ + "**/*" + ] }, { "from": "resources", "to": "resources", - "filter": ["**/*"] + "filter": [ + "**/*" + ] } ], "linux": { @@ -45,7 +63,7 @@ "AppImage" ], "asarUnpack": [ - "**/node_modules/sharp/**" + "**/node_modules/sharp/**" ] }, "files": [ diff --git a/renderer/pages/index.jsx b/renderer/pages/index.jsx index ee55a7d..5eceb0b 100644 --- a/renderer/pages/index.jsx +++ b/renderer/pages/index.jsx @@ -5,9 +5,8 @@ import { ReactCompareSliderImage, } from "react-compare-slider"; -import Animated from '../public/loading.svg' -import Image from 'next/image' - +import Animated from "../public/loading.svg"; +import Image from "next/image"; const Home = () => { const [imagePath, SetImagePath] = useState(""); @@ -57,7 +56,8 @@ const Home = () => { }; const upscaylHandler = async () => { - setProgress("0.00%"); + setUpscaledImagePath(""); + setProgress("Hold on..."); await window.electron.send(commands.UPSCAYL, { scaleFactor, imagePath, @@ -87,7 +87,6 @@ const Home = () => { Select Image - {/* STEP 2 */}

Step 2

@@ -103,8 +102,7 @@ const Home = () => {
- - {/* STEP 3 */} + {/* STEP 3

Step 3

Select Scale Factor

@@ -134,11 +132,11 @@ const Home = () => { 4x
- + */} {/* STEP 4 */}
-

Step 4

+

Step 3

Defaults to Image's path

@@ -149,8 +147,7 @@ const Home = () => { Set Output Folder
- - {/* STEP 5 */} + {/* STEP 4 */}

Step 5

diff --git a/to_upscale_upscayled_4x.jpeg b/to_upscale_upscayled_4x.jpeg index c459785..963c471 100644 Binary files a/to_upscale_upscayled_4x.jpeg and b/to_upscale_upscayled_4x.jpeg differ