mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-24 07:30:19 +01:00
Updated UI
This commit is contained in:
parent
8f5cb99e66
commit
c9cf06ca28
@ -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"));
|
||||
|
@ -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,
|
||||
],
|
||||
|
36
package.json
36
package.json
@ -1,17 +1,31 @@
|
||||
{
|
||||
"name": "upscayl",
|
||||
"private": true,
|
||||
"version": "1.0.3",
|
||||
"version": "1.1.0",
|
||||
"productName": "Upscayl",
|
||||
"author": "TGS963 <nayam@nay.am>",
|
||||
"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": {
|
||||
|
@ -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
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* STEP 2 */}
|
||||
<div className="mt-10">
|
||||
<p className="font-medium text-neutral-100">Step 2</p>
|
||||
@ -103,8 +102,7 @@ const Home = () => {
|
||||
<option value="realesrgan-x4plus-anime">Digital Image</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* STEP 3 */}
|
||||
{/* STEP 3
|
||||
<div className="mt-10">
|
||||
<p className="font-medium text-neutral-100">Step 3</p>
|
||||
<p className="mb-2 text-sm text-neutral-400">Select Scale Factor</p>
|
||||
@ -134,11 +132,11 @@ const Home = () => {
|
||||
4x
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
{/* STEP 4 */}
|
||||
<div className="mt-10">
|
||||
<p className="font-medium text-neutral-100">Step 4</p>
|
||||
<p className="font-medium text-neutral-100">Step 3</p>
|
||||
<p className="mb-2 text-sm text-neutral-400">
|
||||
Defaults to Image's path
|
||||
</p>
|
||||
@ -149,8 +147,7 @@ const Home = () => {
|
||||
Set Output Folder
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* STEP 5 */}
|
||||
{/* STEP 4 */}
|
||||
<div className="mt-10">
|
||||
<p className="mb-2 font-medium text-neutral-100">Step 5</p>
|
||||
<button
|
||||
@ -231,7 +228,7 @@ const Home = () => {
|
||||
alt="Upscayl"
|
||||
/>
|
||||
}
|
||||
className="h-full"
|
||||
className="object-contain"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 934 KiB After Width: | Height: | Size: 1.6 MiB |
Loading…
Reference in New Issue
Block a user