1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-30 18:24:27 +01:00

Merge pull request #6 from TGS963/temporary-release

Auto Update
This commit is contained in:
NayamAmarshe 2022-08-23 18:09:09 +05:30 committed by GitHub
commit 8f5cb99e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 15 deletions

View File

@ -2,13 +2,11 @@ const path = require("path");
const { rootPath } = require("electron-root-path"); const { rootPath } = require("electron-root-path");
const { isPackaged } = require("electron-is-packaged"); const { isPackaged } = require("electron-is-packaged");
const { getPlatform } = require("./getPlatform"); const { getPlatform } = require("./getPlatform");
const {app} = require('electron')
const IS_PROD = process.env.NODE_ENV === "production"; const IS_PROD = process.env.NODE_ENV === "production";
const binariesPath = const binariesPath = path.join(app.getAppPath(), "../", getPlatform(), "./bin");
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 execPath = path.resolve(path.join(binariesPath, "./upscayl"));
const modelsPath = path.resolve(path.join(binariesPath, "./models")); const modelsPath = path.resolve(path.join(binariesPath, "./models"));

9
main/commands.js Normal file
View File

@ -0,0 +1,9 @@
const commands = {
SELECT_FILE: "Select a File",
SELECT_FOLDER: "Select a Folder",
UPSCAYL: "Upscale the Image",
UPSCAYL_DONE: "Upscaling Done",
UPSCAYL_PROGRESS: "Send Progress from Main to Renderer",
};
module.exports = commands;

View File

@ -19,7 +19,7 @@ const {
} = require("electron"); } = require("electron");
const isDev = require("electron-is-dev"); const isDev = require("electron-is-dev");
const prepareNext = require("electron-next"); const prepareNext = require("electron-next");
const commands = require("../constants/commands"); const commands = require("./commands");
const sharp = require("sharp"); const sharp = require("sharp");
// Prepare the renderer once the app is ready // Prepare the renderer once the app is ready
@ -96,6 +96,7 @@ ipcMain.handle(commands.SELECT_FOLDER, async (event, message) => {
}); });
ipcMain.on(commands.UPSCAYL, async (event, payload) => { ipcMain.on(commands.UPSCAYL, async (event, payload) => {
//console.log(execPath)
console.log(payload); console.log(payload);
const model = payload.model; const model = payload.model;
const scale = payload.scaleFactor; const scale = payload.scaleFactor;

0
main/models.js Normal file
View File

7
next.config.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = {
experimental: {
images: {
unoptimized: true
}
}
}

View File

@ -1,7 +1,7 @@
{ {
"name": "upscayl", "name": "upscayl",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.3",
"productName": "Upscayl", "productName": "Upscayl",
"author": "TGS963 <nayam@nay.am>", "author": "TGS963 <nayam@nay.am>",
"email": "nay@am.com", "email": "nay@am.com",
@ -27,11 +27,14 @@
"asar": true, "asar": true,
"extraFiles": [ "extraFiles": [
{ {
"from": "resources/linux/bin", "from": "constants",
"to": "Resources/bin", "to": "constants",
"filter": [ "filter": ["**/*"]
"**/*" },
] {
"from": "resources",
"to": "resources",
"filter": ["**/*"]
} }
], ],
"linux": { "linux": {
@ -39,8 +42,10 @@
"github" "github"
], ],
"target": [ "target": [
"AppImage", "AppImage"
"flatpak" ],
"asarUnpack": [
"**/node_modules/sharp/**"
] ]
}, },
"files": [ "files": [

View File

@ -1,10 +1,14 @@
import { useState, useEffect, useRef } from "react"; import { useState, useEffect, useRef } from "react";
import commands from "../../constants/commands"; import commands from "../../main/commands";
import { import {
ReactCompareSlider, ReactCompareSlider,
ReactCompareSliderImage, ReactCompareSliderImage,
} from "react-compare-slider"; } from "react-compare-slider";
import Animated from '../public/loading.svg'
import Image from 'next/image'
const Home = () => { const Home = () => {
const [imagePath, SetImagePath] = useState(""); const [imagePath, SetImagePath] = useState("");
const [upscaledImagePath, setUpscaledImagePath] = useState(""); const [upscaledImagePath, setUpscaledImagePath] = useState("");
@ -195,7 +199,7 @@ const Home = () => {
{progress.length > 0 && ( {progress.length > 0 && (
<div className="absolute flex h-full w-full flex-col items-center justify-center bg-black/50 backdrop-blur-lg"> <div className="absolute flex h-full w-full flex-col items-center justify-center bg-black/50 backdrop-blur-lg">
<div className="flex flex-col items-center gap-2"> <div className="flex flex-col items-center gap-2">
<img src="/loading.svg" className="w-10" alt="Loading" /> <Image src={Animated} />
<p className="font-bold text-neutral-50">{progress}</p> <p className="font-bold text-neutral-50">{progress}</p>
</div> </div>
</div> </div>