Browse Source

skip processing non jpg images during upload step

Abhinav 1 năm trước cách đây
mục cha
commit
96875eaa76

+ 7 - 0
apps/photos/src/services/clipService.ts

@@ -268,6 +268,13 @@ class ClipServiceImpl {
             );
             );
             return;
             return;
         }
         }
+        const extension = enteFile.metadata.title.split('.').pop();
+        if (!extension || !['jpg', 'jpeg'].includes(extension)) {
+            addLogLine(
+                `skipping non jpg file for clip embedding extraction file: ${enteFile.metadata.title} fileID: ${enteFile.id}`
+            );
+            return;
+        }
         try {
         try {
             await this.liveEmbeddingExtractionQueue.add(async () => {
             await this.liveEmbeddingExtractionQueue.add(async () => {
                 const embedding = await this.extractLocalFileClipImageEmbedding(
                 const embedding = await this.extractLocalFileClipImageEmbedding(