Skip to content

Commit

Permalink
deal with missing storageFilename
Browse files Browse the repository at this point in the history
  • Loading branch information
jstanley0 committed Jan 15, 2024
1 parent f09ade2 commit f036774
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/duplicate_image_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ def _calculate_embeddings(self):
with ImageEmbedder.create_from_options(options) as embedder:
for i in trange(len(self.media_items), ascii=False):
media_item = self.media_items[i]
storage_path = self._get_storage_path(media_item)

mp_image = None
try:
storage_path = self._get_storage_path(media_item)
mp_image = mp.Image.create_from_file(storage_path)
except RuntimeError as error:
except (KeyError, RuntimeError) as error:
logging.warning(
f"Skipping invalid image file:\n"
f"error: {error}\n"
Expand Down

0 comments on commit f036774

Please sign in to comment.