From 337e73c33164582bbdc9433a8939057011a96f04 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 26 Dec 2023 17:41:09 +0000 Subject: [PATCH] . --- helpers/images.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/images.py b/helpers/images.py index 216f11f4..96c28392 100644 --- a/helpers/images.py +++ b/helpers/images.py @@ -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 \ No newline at end of file