1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-25 14:44:36 +01:00

Font changes and permission changes

This commit is contained in:
Nayam Amarshe 2022-08-30 14:15:06 +05:30
parent 7c08bb5e62
commit 86372ea72a
4 changed files with 20 additions and 21 deletions

View File

@ -61,7 +61,9 @@ app.on("ready", async () => {
return { action: "deny" }; return { action: "deny" };
}); });
mainWindow.once("ready-to-show", () => { mainWindow.show(); }) mainWindow.once("ready-to-show", () => {
mainWindow.show();
});
if (!isDev) { if (!isDev) {
autoUpdater.checkForUpdates(); autoUpdater.checkForUpdates();
@ -117,18 +119,15 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
: payload.imagePath.split("/").slice(-1)[0]; : payload.imagePath.split("/").slice(-1)[0];
const fileName = parse(fullfileName).name; const fileName = parse(fullfileName).name;
const fileExt = parse(fullfileName).ext; const fileExt = parse(fullfileName).ext;
const outFile = outputDir + "/" + fileName + "_upscayled_" + scale + "x_" + model + fileExt; const outFile =
outputDir + "/" + fileName + "_upscayled_" + scale + "x_" + model + fileExt;
// UPSCALE // UPSCALE
console.log("PRODUCTION? :", isDev); console.log("PRODUCTION? :", isDev);
console.log("EXEC: ", execPath); console.log("EXEC: ", execPath);
if (fs.existsSync(outFile)) { if (fs.existsSync(outFile)) {
mainWindow.webContents.send( mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile);
commands.UPSCAYL_DONE, } else {
outFile
);
}
else {
let upscayl = spawn( let upscayl = spawn(
execPath, execPath,
[ [
@ -148,6 +147,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
detached: false, detached: false,
} }
); );
let failed = false; let failed = false;
upscayl.stderr.on("data", (stderr) => { upscayl.stderr.on("data", (stderr) => {
console.log(stderr.toString()); console.log(stderr.toString());
@ -157,18 +157,17 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
} }
mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, stderr.toString()); mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, stderr.toString());
}); });
upscayl.on("close", (code) => { upscayl.on("close", (code) => {
if (failed !== true) { if (failed !== true) {
console.log("Done upscaling"); console.log("Done upscaling");
mainWindow.webContents.send( mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile);
commands.UPSCAYL_DONE,
outFile
);
} }
}); });
} }
}); });
// ! AUTO UPDATE STUFF
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => { autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
const dialogOpts = { const dialogOpts = {
type: "info", type: "info",

View File

@ -1,7 +1,7 @@
{ {
"name": "upscayl", "name": "upscayl",
"private": true, "private": true,
"version": "1.2.0", "version": "1.3.0",
"productName": "Upscayl", "productName": "Upscayl",
"homepage": "https://github.com/TGS963/upscayl", "homepage": "https://github.com/TGS963/upscayl",
"contributors": [ "contributors": [

View File

@ -101,7 +101,7 @@ const Home = () => {
SetImagePath(filePath); SetImagePath(filePath);
var dirname = filePath.match(/(.*)[\/\\]/)[1] || ""; var dirname = filePath.match(/(.*)[\/\\]/)[1] || "";
SetOutputPath(dirname); SetOutputPath(dirname);
window.electron.invoke(commands.SET_FILE, {original: filePath}); window.electron.invoke(commands.SET_FILE, { original: filePath });
} }
}; };
@ -173,14 +173,14 @@ const Home = () => {
<div className="mt-0"> <div className="mt-0">
<p className="mb-2 font-medium text-neutral-100">Step 1</p> <p className="mb-2 font-medium text-neutral-100">Step 1</p>
<button <button
className="rounded-lg bg-rose-400 hover:bg-rose-300 transition-colors p-3 font-semibold" className="rounded-lg bg-rose-400 p-3 transition-colors hover:bg-rose-300"
onClick={selectImageHandler} onClick={selectImageHandler}
> >
Select Image Select Image
</button> </button>
</div> </div>
{/* STEP 2 */} {/* STEP 2 */}
<div className="mt-5 animate-step-in"> <div className="animate-step-in mt-5">
<p className="font-medium text-neutral-100">Step 2</p> <p className="font-medium text-neutral-100">Step 2</p>
<p className="mb-2 text-sm text-neutral-400"> <p className="mb-2 text-sm text-neutral-400">
Select Upscaling Type Select Upscaling Type
@ -188,7 +188,7 @@ const Home = () => {
<select <select
name="select-model" name="select-model"
onDrop={(e) => handleDrop(e)} onDrop={(e) => handleDrop(e)}
className="rounded-lg bg-slate-300 hover:bg-slate-200 p-3" className="rounded-lg bg-slate-300 p-3 hover:bg-slate-200"
onChange={handleModelChange} onChange={handleModelChange}
> >
<option value="realesrgan-x4plus">General Photo</option> <option value="realesrgan-x4plus">General Photo</option>
@ -229,13 +229,13 @@ const Home = () => {
</div> */} </div> */}
{/* STEP 3 */} {/* STEP 3 */}
<div className="mt-5 animate-step-in"> <div className="animate-step-in mt-5">
<p className="font-medium text-neutral-100">Step 3</p> <p className="font-medium text-neutral-100">Step 3</p>
<p className="mb-2 text-sm text-neutral-400"> <p className="mb-2 text-sm text-neutral-400">
Defaults to Image's path Defaults to Image's path
</p> </p>
<button <button
className="rounded-lg bg-teal-400 hover:bg-teal-300 transition-colors p-3 mt-1 font-semibold" className="mt-1 rounded-lg bg-teal-400 p-3 transition-colors hover:bg-teal-300"
onClick={outputHandler} onClick={outputHandler}
> >
Set Output Folder Set Output Folder
@ -243,10 +243,10 @@ const Home = () => {
</div> </div>
{/* STEP 4 */} {/* STEP 4 */}
<div className="mt-5 animate-step-in"> <div className="animate-step-in mt-5">
<p className="mb-2 font-medium text-neutral-100">Step 4</p> <p className="mb-2 font-medium text-neutral-100">Step 4</p>
<button <button
className="rounded-lg bg-sky-400 hover:bg-sky-300 transition-colors p-3 font-semibold" className="rounded-lg bg-sky-400 p-3 transition-colors hover:bg-sky-300"
onClick={upscaylHandler} onClick={upscaylHandler}
disabled={progress.length > 0} disabled={progress.length > 0}
> >

0
resources/mac/bin/upscayl Normal file → Executable file
View File