Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prune embedded thumbnails and images

Manav Rathi4b7fe45963e6
diff --git a/web/packages/new/photos/services/exif.ts b/web/packages/new/photos/services/exif.ts
index 9a6cdc85fb..87c8b6e163 100644
--- a/web/packages/new/photos/services/exif.ts
+++ b/web/packages/new/photos/services/exif.ts
@@ -78,5 +78,19 @@ export const indexExif = async (_enteFile: EnteFile, blob: Blob) => {
expanded: true,
});
+ // Remove the embedded thumbnail (if any).
+ delete tags.Thumbnail;
+ delete tags.exif?.Thumbnail;
+
+ // Remove the embedded MPF images (if any).
+ //
+ // The TypeScript definition is out of data and doesn't include the top
+ // level 'mpf', so we need to cast. From the source:
+ //
+ // > The images can be accessed by the tags.Images array (tags.mpf.Images if
+ // > using expanded: true).
+ //
+ delete (tags as Record<string, unknown>).mpf;
+
return tags;
};