1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-03-01 16:20:32 +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, ELECTRON_COMMANDS.UPSCAYL_ERROR,
"Failed to read metadata.", "Failed to read metadata.",
); );
return;
} }
// COPY IMAGE TO TMP FOLDER // COPY IMAGE TO TMP FOLDER
@ -141,7 +140,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
if (!mainWindow) return; if (!mainWindow) return;
if (!failed2 && !stopped) { if (!failed2 && !stopped) {
try { try {
await writeMetadata(outFile, metadata, exiftool); if (metadata) await writeMetadata(outFile, metadata, exiftool);
} catch (error) { } catch (error) {
logit("❌ Error writing metadata: ", error); logit("❌ Error writing metadata: ", error);
mainWindow.webContents.send( mainWindow.webContents.send(

View File

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