mirror of
https://github.com/upscayl/upscayl.git
synced 2026-04-25 03:00:05 -04:00
Fix #646
This commit is contained in:
@@ -10,9 +10,8 @@ const convertAndScale = async (
|
||||
processedImagePath: string,
|
||||
scale: string,
|
||||
saveImageAs: ImageFormat,
|
||||
isAlpha: boolean,
|
||||
) => {
|
||||
if (!isAlpha && !customWidth && scale === "4" && compression === 0) {
|
||||
if (!customWidth && scale === "4" && compression === 0) {
|
||||
logit("Skipping compression for 4x scale and 0% compression");
|
||||
return;
|
||||
}
|
||||
@@ -36,7 +35,6 @@ const convertAndScale = async (
|
||||
if (!originalImage) {
|
||||
throw new Error("Could not grab the original image!");
|
||||
}
|
||||
console.log("🚀 => originalImage:", originalImage);
|
||||
|
||||
// Convert compression percentage (0-100) to compressionLevel (0-9)
|
||||
const compressionLevel = Math.round((compression / 100) * 9);
|
||||
@@ -71,8 +69,6 @@ const convertAndScale = async (
|
||||
orientation: originalImage.orientation,
|
||||
});
|
||||
|
||||
console.log("🚀 => newImage:", newImage);
|
||||
|
||||
const buffer = await newImage
|
||||
.withMetadata({
|
||||
density: originalImage.density,
|
||||
|
||||
@@ -6,6 +6,9 @@ const logit = (...args: any) => {
|
||||
const mainWindow = getMainWindow();
|
||||
if (!mainWindow) return;
|
||||
log.log(...args);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return;
|
||||
}
|
||||
mainWindow.webContents.send(COMMAND.LOG, args.join(" "));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user