From 6979031eace8f61528fe667af67d9f650c532060 Mon Sep 17 00:00:00 2001 From: Sha Zhou Date: Fri, 13 Jun 2025 13:44:59 +0800 Subject: [PATCH] improve image dedup function --- src/utils/image-tools.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/image-tools.ts b/src/utils/image-tools.ts index c0f5e77..b15b76c 100644 --- a/src/utils/image-tools.ts +++ b/src/utils/image-tools.ts @@ -134,6 +134,10 @@ export const dedupImagesWithEmbeddings = ( similarityThreshold: number = 0.86, // Default similarity threshold ): ImageObject[] => { try { + if (newImages.length === 0) { + logWarning('No new images provided for deduplication'); + return []; + } // Quick return for single new image with no existing images if (newImages.length === 1 && existingImages.length === 0) { return newImages;