Added raise for incorrect geo exif

This commit is contained in:
Profitroll 2023-02-14 14:32:20 +01:00
parent 2a100db981
commit 96f4ab2eb9

View File

@ -45,10 +45,13 @@ async def get_duplicates(hash: str, album: str) -> list:
duplicates = [] duplicates = []
cache = get_duplicates_cache(album) cache = get_duplicates_cache(album)
for image_name in cache.keys(): for image_name in cache.keys():
try:
distance = spatial.distance.hamming( distance = spatial.distance.hamming(
hash_hex_to_hash_array(cache[image_name][1]), hash_hex_to_hash_array(cache[image_name][1]),
hash_hex_to_hash_array(hash) hash_hex_to_hash_array(hash)
) )
except ValueError:
continue
print("{0:<30} {1}".format(image_name, distance), flush=True) print("{0:<30} {1}".format(image_name, distance), flush=True)
if distance <= 0.25: if distance <= 0.25:
duplicates.append({"id": cache[image_name][0], "filename": image_name, "difference": distance}) duplicates.append({"id": cache[image_name][0], "filename": image_name, "difference": distance})