Fixed doctest for wrap.
This commit is contained in:
parent
cde8c47e75
commit
2d22c9e012
1 changed files with 6 additions and 6 deletions
|
|
@ -430,7 +430,7 @@ class Jp2k(Jp2kBox):
|
||||||
>>> jfile = glymur.data.goodstuff()
|
>>> jfile = glymur.data.goodstuff()
|
||||||
>>> j2k = glymur.Jp2k(jfile)
|
>>> j2k = glymur.Jp2k(jfile)
|
||||||
>>> tfile = tempfile.NamedTemporaryFile(suffix='jp2')
|
>>> tfile = tempfile.NamedTemporaryFile(suffix='jp2')
|
||||||
>>> j2k.wrap(tfile.name)
|
>>> jp2 = j2k.wrap(tfile.name)
|
||||||
"""
|
"""
|
||||||
if boxes is None:
|
if boxes is None:
|
||||||
# Try to create a reasonable default.
|
# Try to create a reasonable default.
|
||||||
|
|
@ -501,7 +501,8 @@ class Jp2k(Jp2kBox):
|
||||||
typ = cdef.channel_type
|
typ = cdef.channel_type
|
||||||
index = cdef.index
|
index = cdef.index
|
||||||
if colr.colorspace == SRGB:
|
if colr.colorspace == SRGB:
|
||||||
if any([chan + 1 not in assn or typ[chan] != 0 for chan in [0, 1, 2]]):
|
if any([chan + 1 not in assn or typ[chan] != 0
|
||||||
|
for chan in [0, 1, 2]]):
|
||||||
msg = "All color channels must be defined in the "
|
msg = "All color channels must be defined in the "
|
||||||
msg += "channel definition box."
|
msg += "channel definition box."
|
||||||
raise IOError(msg)
|
raise IOError(msg)
|
||||||
|
|
@ -543,7 +544,6 @@ class Jp2k(Jp2kBox):
|
||||||
jp2 = Jp2k(filename)
|
jp2 = Jp2k(filename)
|
||||||
return jp2
|
return jp2
|
||||||
|
|
||||||
|
|
||||||
def read(self, reduce=0, layer=0, area=None, tile=None, verbose=False):
|
def read(self, reduce=0, layer=0, area=None, tile=None, verbose=False):
|
||||||
"""Read a JPEG 2000 image.
|
"""Read a JPEG 2000 image.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue