Skip to content

Commit

Permalink
Merge pull request #411 from girder/glymur-0.9
Browse files Browse the repository at this point in the history
Support Glymur 0.9.
  • Loading branch information
manthey authored Jan 16, 2020
2 parents 7e1e9c3 + 0c77ee3 commit 1791934
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions sources/openjpeg/large_image_source_openjpeg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,22 @@ def _getAssociatedImages(self):
"""
self._associatedImages = {}
for box in self._openjpeg.box:
if box.box_id == self._xmlTag or box.box_id in self._boxToTag:
box_id = box.box_id
if box_id == 'xxxx':
box_id = getattr(box, 'claimed_box_id', box.box_id)
if box_id == self._xmlTag or box_id in self._boxToTag:
data = self._readbox(box)
if data is None:
continue
if box.box_id == self._xmlTag:
if box_id == self._xmlTag:
self._parseMetadataXml(data)
continue
try:
self._associatedImages[self._boxToTag[box.box_id]] = PIL.Image.open(
self._associatedImages[self._boxToTag[box_id]] = PIL.Image.open(
BytesIO(data))
except Exception:
pass
if box.box_id == 'jp2c':
if box_id == 'jp2c':
for segment in box.codestream.segment:
if segment.marker_id == 'CME' and hasattr(segment, 'ccme'):
self._parseMetadataXml(segment.ccme)
Expand Down
3 changes: 2 additions & 1 deletion sources/openjpeg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def prerelease_local_scheme(version):
],
install_requires=[
'large-image>=1.0.0',
'glymur>=0.8.18,<0.9',
'glymur>=0.8.18,<0.9 ; python_version < "3.6"',
'glymur>=0.8.18 ; python_version >= "3.6"',
],
extras_require={
'girder': 'girder-large-image>=1.0.0',
Expand Down

0 comments on commit 1791934

Please sign in to comment.