Fix the fallback

This commit is contained in:
Manav Rathi 2024-07-22 15:16:58 +05:30
parent 09036bb57f
commit ca8ae8c6e7
No known key found for this signature in database

View File

@ -121,9 +121,10 @@ export const updateExifIfNeeded = async (
// Not a JPEG (likely). // Not a JPEG (likely).
if (extension != "jpeg" && extension != "jpg") return stream; if (extension != "jpeg" && extension != "jpg") return stream;
const blob = await new Response(stream).blob();
try { try {
const updatedBlob = await setJPEGExifDateTimeOriginal( const updatedBlob = await setJPEGExifDateTimeOriginal(
await new Response(stream).blob(), blob,
new Date(enteFile.pubMagicMetadata.data.editedTime / 1000), new Date(enteFile.pubMagicMetadata.data.editedTime / 1000),
); );
return updatedBlob.stream(); return updatedBlob.stream();
@ -133,7 +134,7 @@ export const updateExifIfNeeded = async (
// in case of errors, return the original back instead of causing the // in case of errors, return the original back instead of causing the
// entire download or export to fail. // entire download or export to fail.
log.error(`Failed to modify Exif date for ${fileName}`, e); log.error(`Failed to modify Exif date for ${fileName}`, e);
return stream; return blob.stream();
} }
}; };