Not supporting on 1.5
This commit is contained in:
parent
27b67113bc
commit
18c1687b28
2 changed files with 7 additions and 2 deletions
|
|
@ -763,14 +763,17 @@ class Jp2k(Jp2kBox):
|
||||||
"""
|
"""
|
||||||
Slicing protocol.
|
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)
|
codestream = self.get_codestream(header_only=True)
|
||||||
if isinstance(pargs, int):
|
if isinstance(pargs, int):
|
||||||
# Not a very good use of this protocol, but technically legal.
|
# Not a very good use of this protocol, but technically legal.
|
||||||
# This retrieves a single row.
|
# This retrieves a single row.
|
||||||
row = pargs
|
row = pargs
|
||||||
area = (row, 0, row + 1, codestream.segment[1].xsiz)
|
area = (row, 0, row + 1, codestream.segment[1].xsiz)
|
||||||
|
|
||||||
# Take out the singleton row dimension.
|
|
||||||
return self.read(area=area).squeeze()
|
return self.read(area=area).squeeze()
|
||||||
|
|
||||||
if isinstance(pargs, slice):
|
if isinstance(pargs, slice):
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ def load_tests(loader, tests, ignore):
|
||||||
return tests
|
return tests
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(glymur.version.openjpeg_version[0] == '1',
|
||||||
|
"Slice protocol not supported in version 1.x")
|
||||||
class TestSliceProtocol(unittest.TestCase):
|
class TestSliceProtocol(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
Test slice protocol, i.e. when using [ ] to read image data.
|
Test slice protocol, i.e. when using [ ] to read image data.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue