1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-23 23:21:05 +01:00

Fix scaling

This commit is contained in:
Nayam Amarshe 2023-09-09 18:31:31 +05:30
parent 883171a99f
commit 2def61e194
2 changed files with 7 additions and 5 deletions

View File

@ -255,7 +255,7 @@ const convertAndScale = async (
.withMetadata(); // Keep metadata
// Change the output according to the saveImageAs
if (saveImageAs === "png") {
newImage.png({ compressionLevel: quality });
newImage.png({ quality: 100 - quality });
} else if (saveImageAs === "jpg") {
console.log("Quality: ", quality);
newImage.jpeg({ quality: 100 - quality });
@ -555,7 +555,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
}
});
//------------------------Folder Upscayl-----------------------------//
//------------------------Batch Upscayl-----------------------------//
ipcMain.on(commands.FOLDER_UPSCAYL, async (event, payload) => {
if (!mainWindow) return;
// GET THE MODEL
@ -656,7 +656,7 @@ ipcMain.on(commands.FOLDER_UPSCAYL, async (event, payload) => {
await convertAndScale(
inputDir + slash + file,
outputDir + slash + file.slice(0, -3) + "png",
outputDir + slash + file,
outputDir + slash + file.slice(0, -3) + saveImageAs,
payload.scale,
saveImageAs,
onError

View File

@ -399,6 +399,7 @@ const Home = () => {
const upscaylHandler = async () => {
logit("🔄 Resetting Upscaled Image Path");
setUpscaledImagePath("");
setUpscaledBatchFolderPath("");
if (imagePath !== "" || batchFolderPath !== "") {
setProgress("Hold on...");
@ -620,8 +621,9 @@ const Home = () => {
{batchMode &&
upscaledBatchFolderPath.length === 0 &&
batchFolderPath.length > 0 && (
<p className="select-none font-bold text-neutral-50">
Selected folder: {batchFolderPath}
<p className="select-none text-neutral-50">
<span className="font-bold">Selected folder:</span>{" "}
{batchFolderPath}
</p>
)}