.
This commit is contained in:
+3
-1
@@ -191,7 +191,8 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo
|
||||
is_dicom = True
|
||||
# ----
|
||||
|
||||
except pydicom.errors.InvalidDicomError as e:
|
||||
# Random error catching is bad
|
||||
except (pydicom.errors.InvalidDicomError, TypeError) as e:
|
||||
print("dicom error", img)
|
||||
try: # This is horrible (but needed for current unit tests)
|
||||
# (we use a temporary file that breaks here)
|
||||
@@ -202,6 +203,7 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo
|
||||
case "blake3":
|
||||
hash = blake3(img.read()).hexdigest()
|
||||
except AttributeError:
|
||||
print("BAD")
|
||||
return hash, False
|
||||
|
||||
return hash, is_dicom
|
||||
Reference in New Issue
Block a user