From 1b38242d816161ccf42fc327e7d13cc0f583d16e Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Fri, 17 Mar 2017 09:57:37 +0100 Subject: [PATCH] Extend unit tests --- nd2reader/raw_metadata.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nd2reader/raw_metadata.py b/nd2reader/raw_metadata.py index 89b574b..20870a7 100644 --- a/nd2reader/raw_metadata.py +++ b/nd2reader/raw_metadata.py @@ -58,11 +58,14 @@ class RawMetadata(object): return callback() return None + def _parse_width_or_height(self, key): + return self.image_attributes[six.b('SLxImageAttributes')][six.b(key)] + def _parse_height(self): - return self.image_attributes[six.b('SLxImageAttributes')][six.b('uiHeight')] + return self._parse_width_or_height('uiHeight') def _parse_width(self): - return self.image_attributes[six.b('SLxImageAttributes')][six.b('uiWidth')] + return self._parse_width_or_height('uiWidth') def _parse_date(self): return parse_date(self.image_text_info[six.b('SLxImageTextInfo')])