Not supporting on 1.5

This commit is contained in:
jevans 2014-09-13 20:35:35 -04:00
commit 18c1687b28
2 changed files with 7 additions and 2 deletions

View file

@ -763,14 +763,17 @@ class Jp2k(Jp2kBox):
"""
Slicing protocol.
"""
if re.match("1.", version.openjpeg_version):
msg = "Not implemented for version 1.x of OpenJPEG. Use the read "
msg += "method instead."
raise NotImplementedError(msg)
codestream = self.get_codestream(header_only=True)
if isinstance(pargs, int):
# Not a very good use of this protocol, but technically legal.
# This retrieves a single row.
row = pargs
area = (row, 0, row + 1, codestream.segment[1].xsiz)
# Take out the singleton row dimension.
return self.read(area=area).squeeze()
if isinstance(pargs, slice):

View file

@ -52,6 +52,8 @@ def load_tests(loader, tests, ignore):
return tests
@unittest.skipIf(glymur.version.openjpeg_version[0] == '1',
"Slice protocol not supported in version 1.x")
class TestSliceProtocol(unittest.TestCase):
"""
Test slice protocol, i.e. when using [ ] to read image data.