mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-28 01:10:52 +01:00
Fix #499
This commit is contained in:
parent
0ff2eb8224
commit
9a58f2d2aa
@ -147,7 +147,8 @@ const batchUpscayl = async (event, payload) => {
|
||||
mainWindow &&
|
||||
mainWindow.webContents.send(
|
||||
COMMAND.UPSCAYL_ERROR,
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page."
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page.\n" +
|
||||
error
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -173,7 +173,8 @@ const doubleUpscayl = async (event, payload) => {
|
||||
mainWindow &&
|
||||
mainWindow.webContents.send(
|
||||
COMMAND.UPSCAYL_ERROR,
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page."
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page.\n" +
|
||||
error
|
||||
);
|
||||
upscayl.kill();
|
||||
}
|
||||
|
@ -164,12 +164,13 @@ const imageUpscayl = async (event, payload) => {
|
||||
try {
|
||||
await convertAndScale(
|
||||
inputDir + slash + fullfileName,
|
||||
isAlpha ? outFile + ".png" : outFile,
|
||||
outFile,
|
||||
outFile,
|
||||
desiredScale,
|
||||
saveImageAs,
|
||||
onError
|
||||
);
|
||||
if (saveImageAs === "jpg") fs.unlinkSync(outFile);
|
||||
mainWindow.setProgressBar(-1);
|
||||
mainWindow.webContents.send(
|
||||
COMMAND.UPSCAYL_DONE,
|
||||
@ -186,7 +187,8 @@ const imageUpscayl = async (event, payload) => {
|
||||
upscayl.kill();
|
||||
mainWindow.webContents.send(
|
||||
COMMAND.UPSCAYL_ERROR,
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page."
|
||||
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page.\n" +
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -40,18 +40,20 @@ const convertAndScale = async (
|
||||
// Convert compression percentage (0-100) to compressionLevel (0-9)
|
||||
const compressionLevel = Math.round((compression / 100) * 9);
|
||||
|
||||
logit("📐 Processing Image: ", {
|
||||
originalWidth: originalImage.width,
|
||||
originalHeight: originalImage.height,
|
||||
scale,
|
||||
saveImageAs,
|
||||
compressionPercentage: compression,
|
||||
compressionLevel,
|
||||
});
|
||||
logit(
|
||||
"📐 Processing Image: ",
|
||||
JSON.stringify({
|
||||
originalWidth: originalImage.width,
|
||||
originalHeight: originalImage.height,
|
||||
scale,
|
||||
saveImageAs,
|
||||
compressionPercentage: compression,
|
||||
compressionLevel,
|
||||
})
|
||||
);
|
||||
|
||||
const buffer = await newImage.toBuffer();
|
||||
try {
|
||||
logit("");
|
||||
await sharp(buffer, {
|
||||
limitInputPixels: false,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user