Skip to content

armgit / ente

Public Imported from GitHub
0

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

Tinker

Manav Rathi5b928883a6a5
diff --git a/web/apps/photos/src/services/upload/metadataService.ts b/web/apps/photos/src/services/upload/metadataService.ts
index fa744bb853..a981f99bc6 100644
--- a/web/apps/photos/src/services/upload/metadataService.ts
+++ b/web/apps/photos/src/services/upload/metadataService.ts
@@ -416,21 +416,18 @@ const areLivePhotoAssets = (f: LivePhotoIdentifier, g: LivePhotoIdentifier) => {
areNotSameFileType &&
firstFileNameWithoutSuffix === secondFileNameWithoutSuffix
) {
- const LIVE_PHOTO_ASSET_SIZE_LIMIT = 20 * 1024 * 1024; // 20MB
-
- // checks size of live Photo assets are less than allowed limit
- // I did that based on the assumption that live photo assets ideally would not be larger than LIVE_PHOTO_ASSET_SIZE_LIMIT
- // also zipping library doesn't support stream as a input
- if (
- f.size <= LIVE_PHOTO_ASSET_SIZE_LIMIT &&
- g.size <= LIVE_PHOTO_ASSET_SIZE_LIMIT
- ) {
+ // Also check that the size of an individual Live Photo asset is less
+ // than an (arbitrary) limit. This should be true in practice as the
+ // videos for a live photo are a few seconds long. Further on, the
+ // zipping library that we use doesn't support stream as a input.
+
+ const maxAssetSize = 20 * 1024 * 1024; /* 20MB */
+
+ if (f.size <= maxAssetSize && g.size <= maxAssetSize) {
return true;
} else {
- log.error(
- `${CustomError.TOO_LARGE_LIVE_PHOTO_ASSETS} - ${JSON.stringify({
- fileSizes: [f.size, g.size],
- })}`,
+ log.info(
+ `Not classifying assets with too large sizes ${[f.size, g.size]} as a live photo`,
);
}
}
diff --git a/web/packages/shared/error/index.ts b/web/packages/shared/error/index.ts
index fab3161b21..cf01a38435 100644
--- a/web/packages/shared/error/index.ts
+++ b/web/packages/shared/error/index.ts
@@ -48,7 +48,6 @@ export const CustomError = {
SUBSCRIPTION_NEEDED: "subscription not present",
NOT_FOUND: "not found ",
NO_METADATA: "no metadata",
- TOO_LARGE_LIVE_PHOTO_ASSETS: "too large live photo assets",
NOT_A_DATE: "not a date",
NOT_A_LOCATION: "not a location",
FILE_ID_NOT_FOUND: "file with id not found",