1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-27 17:00:52 +01:00

Add null check on metadata, Continue upscayl if metadata readig failed

This commit is contained in:
David 2024-10-27 19:30:36 +04:00
parent dee6763af0
commit e914543235
2 changed files with 2 additions and 4 deletions

View File

@ -56,7 +56,6 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
ELECTRON_COMMANDS.UPSCAYL_ERROR,
"Failed to read metadata.",
);
return;
}
// COPY IMAGE TO TMP FOLDER
@ -141,7 +140,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
if (!mainWindow) return;
if (!failed2 && !stopped) {
try {
await writeMetadata(outFile, metadata, exiftool);
if (metadata) await writeMetadata(outFile, metadata, exiftool);
} catch (error) {
logit("❌ Error writing metadata: ", error);
mainWindow.webContents.send(

View File

@ -58,7 +58,6 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
ELECTRON_COMMANDS.UPSCAYL_ERROR,
"Failed to read metadata.",
);
return;
}
const outFile =
@ -159,7 +158,7 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
const onClose = async () => {
if (!failed && !stopped) {
try {
await writeMetadata(outFile, metadata, exiftool);
if (metadata) await writeMetadata(outFile, metadata, exiftool);
} catch (error) {
logit("❌ Error writing metadata: ", error);
mainWindow.webContents.send(