Skip to content

armgit / ente

Public Imported from GitHub
0

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

Ignore (expected) errors when trying to cache face crops

Manav Rathie58e96091f26
diff --git a/web/apps/photos/src/services/machineLearning/faceService.ts b/web/apps/photos/src/services/machineLearning/faceService.ts
index 0f26950f8a..3116ac23c2 100644
--- a/web/apps/photos/src/services/machineLearning/faceService.ts
+++ b/web/apps/photos/src/services/machineLearning/faceService.ts
@@ -225,11 +225,21 @@ class FaceService {
face.detection,
syncContext.config.faceCrop,
);
- face.crop = await storeFaceCrop(
- face.id,
- faceCrop,
- syncContext.config.faceCrop.blobOptions,
- );
+ try {
+ face.crop = await storeFaceCrop(
+ face.id,
+ faceCrop,
+ syncContext.config.faceCrop.blobOptions,
+ );
+ } catch (e) {
+ // TODO(MR): Temporarily ignoring errors about failing cache puts
+ // when using a custom scheme in Electron. Needs an alternative
+ // approach, perhaps OPFS.
+ console.error(
+ "Ignoring error when caching face crop, the face crop will not be available",
+ e,
+ );
+ }
const blob = await imageBitmapToBlob(faceCrop.image);
faceCrop.image.close();
return blob;