This commit is contained in:
Ross
2023-12-26 17:34:19 +00:00
parent 714f472da6
commit 73bc0fe7ff
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -241,6 +241,7 @@ class SeriesImageBase(models.Model):
def save(self, *args, **kwargs):
"""Override save method to add image hash"""
if self.image:
print(self.pk, self.image)
if not self.image_md5_hash:
image_hash, is_dicom = get_image_hash(self.image, hash_type="md5", direct_pixel_data=False)
+1 -1
View File
@@ -192,7 +192,7 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo
# ----
except pydicom.errors.InvalidDicomError as e:
print("dicom error")
print("dicom error", img)
try: # This is horrible (but needed for current unit tests)
# (we use a temporary file that breaks here)
img.file.open()