Merge branch 'master' of gitssh://web.xkjq.uk:30001/ross/rad

This commit is contained in:
Ross
2021-02-13 20:19:19 +00:00
25 changed files with 364 additions and 186 deletions
+3 -1
View File
@@ -21,6 +21,8 @@ def image_as_base64(image_file):
# encoded_string = base64.b64encode(img_f.read())
encoded_string = base64.b64encode(image_file.file.read())
mimetype, enc = mimetypes.guess_type(image_file.path)
if "dicom" in mimetype:
return "data:{};base64,{}".format(mimetype, encoded_string.decode("utf-8"))
return "data:image/{};base64,{}".format(mimetype, encoded_string.decode("utf-8"))
@@ -54,4 +56,4 @@ def pil_dicom_image(source, exif_orientation=True, **options):
#if exif_orientation:
# image = utils.exif_orientation(image)
return image
return image