Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix(exif):added-back-condition

Aswin Asok601763caa5a4
diff --git a/web/packages/gallery/services/exif.ts b/web/packages/gallery/services/exif.ts
index 3c79619936..390d7e9a86 100644
--- a/web/packages/gallery/services/exif.ts
+++ b/web/packages/gallery/services/exif.ts
@@ -111,8 +111,14 @@ const parseDates = (tags: RawExifTags) => {
// Some customers (not sure how prevalent this is) reported photos with Exif
// dates set to "0000:00:00 00:00:00". Ignore any date whose timestamp is 0
// so that we try with a subsequent (possibly correct) date in the sequence.
- const valid = (d: ParsedMetadataDate | undefined) =>
- d?.timestamp ? d : undefined;
+ //
+ // Filter out a known corrupted date value, "4501:01:01 00:00:00".
+ // Certain devices default to this bogus timestamp, so skip it to allow other dates.
+ const valid = (d: ParsedMetadataDate | undefined) => {
+ if (!d?.timestamp) return undefined;
+ if (d.dateTime === "4501-01-01T00:00:00.000") return undefined;
+ return d;
+ };
const exif = parseExifDates(tags);
const iptc = parseIPTCDates(tags);