From 3e02c748ce9e94bc372d0b60c25a71e82f06c27d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 23 Jul 2024 16:20:53 +0530 Subject: [PATCH] Delete the raw xmp --- web/packages/new/photos/services/exif.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/packages/new/photos/services/exif.ts b/web/packages/new/photos/services/exif.ts index 87c8b6e163..69c3b4d577 100644 --- a/web/packages/new/photos/services/exif.ts +++ b/web/packages/new/photos/services/exif.ts @@ -92,5 +92,17 @@ export const indexExif = async (_enteFile: EnteFile, blob: Blob) => { // delete (tags as Record).mpf; + // Remove the raw XMP (if any). + // + // The `includeUnknown` flag does not have any effect on the XMP parser, so + // we already get all the key value pairs in the XMP as part of the "xmp" + // object, retaining the raw string is unnecessary. + // + // We need to cast to remove the non-optional _raw property. Be aware that + // this means that from this point onwards, the TypeScript type is out of + // sync with the actual value (TypeScript type says _raw is always present, + // while the actual value doesn't have it). + delete (tags.xmp as Partial)?._raw; + return tags; };