Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add support for rending images of live photos + heic

Neeraj Gupta76187684e941
diff --git a/apps/cast/package.json b/apps/cast/package.json
index 543bf0b808..ef2d8b7fa3 100644
--- a/apps/cast/package.json
+++ b/apps/cast/package.json
@@ -10,7 +10,8 @@
"export": "next export"
},
"dependencies": {
- "mime-types": "^2.1.35"
+ "mime-types": "^2.1.35",
+ "jszip": "3.10.1"
},
"devDependencies": {
"sass": "^1.69.5"
diff --git a/apps/cast/src/pages/slideshow.tsx b/apps/cast/src/pages/slideshow.tsx
index 79ab550ab7..f851f941b3 100644
--- a/apps/cast/src/pages/slideshow.tsx
+++ b/apps/cast/src/pages/slideshow.tsx
@@ -83,10 +83,7 @@ export default function Slideshow() {
const isFileEligibleForCast = (file: EnteFile) => {
const fileType = file.metadata.fileType;
- if (
- fileType !== FILE_TYPE.IMAGE
- // && fileType !== FILE_TYPE.VIDEO
- ) {
+ if (fileType !== FILE_TYPE.IMAGE && fileType !== FILE_TYPE.LIVE_PHOTO) {
return false;
}
diff --git a/apps/cast/src/utils/file/index.ts b/apps/cast/src/utils/file/index.ts
index 9900cd3f94..4f5851190a 100644
--- a/apps/cast/src/utils/file/index.ts
+++ b/apps/cast/src/utils/file/index.ts
@@ -546,9 +546,19 @@ export const downloadFileAsBlob = async (
} else {
fileBlob = await (await fetch(fileURL)).blob();
}
+ if (file.metadata.fileType === FILE_TYPE.LIVE_PHOTO) {
+ const livePhoto = await decodeLivePhoto(file, fileBlob);
+ fileBlob = new Blob([livePhoto.image]);
+ }
+ const convertedBlob = await getRenderableImage(
+ file.metadata.title,
+ fileBlob
+ );
+ fileBlob = convertedBlob;
const fileType = await getFileType(
new File([fileBlob], file.metadata.title)
);
+
fileBlob = new Blob([fileBlob], { type: fileType.mimeType });
return fileBlob;
} catch (e) {