mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
Fix scaling
This commit is contained in:
parent
883171a99f
commit
2def61e194
@ -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
|
||||
|
@ -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>
|
||||
)}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user