diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be7515a3..7405f0f3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ ### Improvements - Fix the DICOM limit to say "Series" instead of "Studies" ([#1379](../../pull/1379)) +- Add token authentication option for DICOMweb ([#1349](../../pull/1349)) ### Bug Fixes - Fix an issue applying ICC profile adjustments to multiple image modes ([#1382](../../pull/1382)) +- Guard against bad tifffile magnification values ([#1383](../../pull/1383)) ## 1.26.1 diff --git a/sources/tifffile/large_image_source_tifffile/__init__.py b/sources/tifffile/large_image_source_tifffile/__init__.py index 9aa70c18d..ab4d36bd3 100644 --- a/sources/tifffile/large_image_source_tifffile/__init__.py +++ b/sources/tifffile/large_image_source_tifffile/__init__.py @@ -125,12 +125,12 @@ def __init__(self, path, **kwargs): # noqa try: unit = {2: 25.4, 3: 10}[page.tags['ResolutionUnit'].value.real] - if (page.tags['XResolution'].value[0] and ( - page.tags['XResolution'].value[1] / page.tags['XResolution'].value[0]) >= 100): + if (page.tags['XResolution'].value[0] and page.tags['XResolution'].value[1] and ( + page.tags['XResolution'].value[0] / page.tags['XResolution'].value[1]) >= 100): self._mm_x = (unit * page.tags['XResolution'].value[1] / page.tags['XResolution'].value[0]) - if (page.tags['YResolution'].value[0] and ( - page.tags['YResolution'].value[1] / page.tags['YResolution'].value[0]) >= 100): + if (page.tags['YResolution'].value[0] and page.tags['YResolution'].value[1] and ( + page.tags['YResolution'].value[0] / page.tags['YResolution'].value[1]) >= 100): self._mm_y = (unit * page.tags['YResolution'].value[1] / page.tags['YResolution'].value[0]) except Exception: