Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix

Manav Rathic4f6ed693856
diff --git a/web/packages/gallery/services/upload/upload-service.ts b/web/packages/gallery/services/upload/upload-service.ts
index bce8cc55b1..6a0cb9ba31 100644
--- a/web/packages/gallery/services/upload/upload-service.ts
+++ b/web/packages/gallery/services/upload/upload-service.ts
@@ -1000,8 +1000,9 @@ const readLivePhotoDetails = async ({ image, video }: LivePhotoAssets) => {
return {
fileTypeInfo: {
fileType: FileType.livePhoto,
- extension: `${img.fileTypeInfo.extension}+${vid.fileTypeInfo.extension}`,
- imageType: img.fileTypeInfo.extension,
+ // Use the extension of the image component as the extension of the
+ // live photo.
+ extension: img.fileTypeInfo.extension,
},
fileSize: img.fileSize + vid.fileSize,
lastModifiedMs: img.lastModifiedMs,
@@ -1357,9 +1358,9 @@ const readLivePhoto = async (
hasStaticThumbnail,
} = await augmentWithThumbnail(
livePhotoAssets.image,
- // TODO: Update underlying type
- // @ts-ignore
- { extension: fileTypeInfo.imageType, fileType: FileType.image },
+ // For live photos, the extension field in the file type info is the
+ // extension of the image component of the live photo.
+ { fileType: FileType.image, extension: fileTypeInfo.extension },
await readUploadItem(livePhotoAssets.image),
);
const videoFileStreamOrData = await readUploadItem(livePhotoAssets.video);
diff --git a/web/packages/media/file-type.ts b/web/packages/media/file-type.ts
index 278d6fc781..c0deee74bb 100644
--- a/web/packages/media/file-type.ts
+++ b/web/packages/media/file-type.ts
@@ -36,11 +36,11 @@ export interface FileTypeInfo {
/**
* A lowercased, standardized extension for files of the current type.
*
- * TODO(MR): This in not valid for live photos.
+ * For live photos, this is set to the extension of the image component of
+ * the live photo.
*/
extension: string;
mimeType?: string;
- imageType?: string;
}
// list of format that were missed by type-detection for some files.