Add struct.error to exceptions caught in core.io.is_dicom_image
pydicom was choking on a TIFF file and throwing a struct.error exception
which wasn't being caught
"""I/O helper functions for pylinac."""
import os
import os.path as osp
+import struct
from tempfile import TemporaryDirectory
from typing import Callable, List
from urllib.error import HTTPError, URLError
@@ -54,7 +55,7 @@ def is_dicom_image(file: str) -> bool:
img.file_meta.TransferSyntaxUID = pydicom.uid.ImplicitVRLittleEndian
img.pixel_array
result = True
- except (AttributeError, TypeError, KeyError):
+ except (AttributeError, TypeError, KeyError, struct.error):
pass
return result
