Merge branch 'devel'
This commit is contained in:
commit
e8271addec
10 changed files with 47 additions and 61 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
Jun 06, 2013 - v0.1.5 Changed ColourSpecificationBox attribute "color_space"
|
||||||
|
to "colorspace". Fixed MANIFEST issue affecting PyPI installs.
|
||||||
|
|
||||||
Jun 05, 2013 - v0.1.4 Added Exif UUID read support.
|
Jun 05, 2013 - v0.1.4 Added Exif UUID read support.
|
||||||
|
|
||||||
Jun 02, 2013 - v0.1.3p1 Raising IOErrors when code block size and precinct
|
Jun 02, 2013 - v0.1.3p1 Raising IOErrors when code block size and precinct
|
||||||
|
|
|
||||||
22
MANIFEST
22
MANIFEST
|
|
@ -1,22 +0,0 @@
|
||||||
# file GENERATED by distutils, do NOT edit
|
|
||||||
setup.py
|
|
||||||
bin/jp2dump
|
|
||||||
glymur/__init__.py
|
|
||||||
glymur/codestream.py
|
|
||||||
glymur/core.py
|
|
||||||
glymur/jp2box.py
|
|
||||||
glymur/jp2dump.py
|
|
||||||
glymur/jp2k.py
|
|
||||||
glymur/data/nemo.jp2
|
|
||||||
glymur/lib/__init__.py
|
|
||||||
glymur/lib/openjp2.py
|
|
||||||
glymur/lib/test/__init__.py
|
|
||||||
glymur/lib/test/test_openjp2.py
|
|
||||||
glymur/test/__init__.py
|
|
||||||
glymur/test/test_callbacks.py
|
|
||||||
glymur/test/test_codestream.py
|
|
||||||
glymur/test/test_jp2k.py
|
|
||||||
glymur/test/test_opj_suite.py
|
|
||||||
glymur/test/test_opj_suite_neg.py
|
|
||||||
glymur/test/test_opj_suite_write.py
|
|
||||||
glymur/test/test_printing.py
|
|
||||||
4
MANIFEST.in
Normal file
4
MANIFEST.in
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
include *.txt *.md
|
||||||
|
recursive-include *.txt *.py
|
||||||
|
prune build
|
||||||
|
exclude readthedocs-pip-requirements.txt
|
||||||
|
|
@ -78,7 +78,7 @@ copyright = u'2013, John Evans'
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '0.1'
|
version = '0.1'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '0.1.4'
|
release = '0.1.5'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ class ColourSpecificationBox(Jp2kBox):
|
||||||
boxes.
|
boxes.
|
||||||
approximation : int
|
approximation : int
|
||||||
Measure of colorspace accuracy.
|
Measure of colorspace accuracy.
|
||||||
color_space : int or None
|
colorspace : int or None
|
||||||
Enumerated colorspace, corresponds to one of 'sRGB', 'greyscale', or
|
Enumerated colorspace, corresponds to one of 'sRGB', 'greyscale', or
|
||||||
'YCC'. If not None, then icc_profile must be None.
|
'YCC'. If not None, then icc_profile must be None.
|
||||||
icc_profile : byte array or None
|
icc_profile : byte array or None
|
||||||
|
|
@ -170,8 +170,8 @@ class ColourSpecificationBox(Jp2kBox):
|
||||||
if self.approximation is not 0:
|
if self.approximation is not 0:
|
||||||
x = _approximation_display[self.approximation]
|
x = _approximation_display[self.approximation]
|
||||||
msg += '\n Approximation: {0}'.format(x)
|
msg += '\n Approximation: {0}'.format(x)
|
||||||
if self.color_space is not None:
|
if self.colorspace is not None:
|
||||||
x = _colorspace_map_display[self.color_space]
|
x = _colorspace_map_display[self.colorspace]
|
||||||
msg += '\n Colorspace: {0}'.format(x)
|
msg += '\n Colorspace: {0}'.format(x)
|
||||||
else:
|
else:
|
||||||
x = len(self.icc_profile)
|
x = len(self.icc_profile)
|
||||||
|
|
@ -214,12 +214,12 @@ class ColourSpecificationBox(Jp2kBox):
|
||||||
if method == 1:
|
if method == 1:
|
||||||
# enumerated colour space
|
# enumerated colour space
|
||||||
buffer = f.read(4)
|
buffer = f.read(4)
|
||||||
kwargs['color_space'], = struct.unpack('>I', buffer)
|
kwargs['colorspace'], = struct.unpack('>I', buffer)
|
||||||
kwargs['icc_profile'] = None
|
kwargs['icc_profile'] = None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# ICC profile
|
# ICC profile
|
||||||
kwargs['color_space'] = None
|
kwargs['colorspace'] = None
|
||||||
n = offset + length - f.tell()
|
n = offset + length - f.tell()
|
||||||
kwargs['icc_profile'] = f.read(n)
|
kwargs['icc_profile'] = f.read(n)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ class TestJp2k(unittest.TestCase):
|
||||||
self.assertEqual(jp2k.box[2].box[1].longname, 'Colour Specification')
|
self.assertEqual(jp2k.box[2].box[1].longname, 'Colour Specification')
|
||||||
self.assertEqual(jp2k.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2k.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2k.box[2].box[1].approximation, 0)
|
self.assertEqual(jp2k.box[2].box[1].approximation, 0)
|
||||||
self.assertEqual(jp2k.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2k.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
self.assertIsNone(jp2k.box[2].box[1].icc_profile)
|
self.assertIsNone(jp2k.box[2].box[1].icc_profile)
|
||||||
|
|
||||||
@unittest.skipIf(data_root is None,
|
@unittest.skipIf(data_root is None,
|
||||||
|
|
@ -370,14 +370,14 @@ class TestJp2k(unittest.TestCase):
|
||||||
j = Jp2k(tfile.name, 'wb')
|
j = Jp2k(tfile.name, 'wb')
|
||||||
data = np.zeros((128, 128, 3), dtype=np.uint8)
|
data = np.zeros((128, 128, 3), dtype=np.uint8)
|
||||||
j.write(data, colorspace='rgb')
|
j.write(data, colorspace='rgb')
|
||||||
self.assertEqual(j.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(j.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
def test_specify_gray(self):
|
def test_specify_gray(self):
|
||||||
with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile:
|
with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile:
|
||||||
j = Jp2k(tfile.name, 'wb')
|
j = Jp2k(tfile.name, 'wb')
|
||||||
data = np.zeros((128, 128), dtype=np.uint8)
|
data = np.zeros((128, 128), dtype=np.uint8)
|
||||||
j.write(data, colorspace='gray')
|
j.write(data, colorspace='gray')
|
||||||
self.assertEqual(j.box[2].box[1].color_space,
|
self.assertEqual(j.box[2].box[1].colorspace,
|
||||||
glymur.core.GREYSCALE)
|
glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_specify_grey(self):
|
def test_specify_grey(self):
|
||||||
|
|
@ -385,7 +385,7 @@ class TestJp2k(unittest.TestCase):
|
||||||
j = Jp2k(tfile.name, 'wb')
|
j = Jp2k(tfile.name, 'wb')
|
||||||
data = np.zeros((128, 128), dtype=np.uint8)
|
data = np.zeros((128, 128), dtype=np.uint8)
|
||||||
j.write(data, colorspace='grey')
|
j.write(data, colorspace='grey')
|
||||||
self.assertEqual(j.box[2].box[1].color_space,
|
self.assertEqual(j.box[2].box[1].colorspace,
|
||||||
glymur.core.GREYSCALE)
|
glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_grey_with_extra_component(self):
|
def test_grey_with_extra_component(self):
|
||||||
|
|
@ -396,7 +396,7 @@ class TestJp2k(unittest.TestCase):
|
||||||
self.assertEqual(j.box[2].box[0].height, 128)
|
self.assertEqual(j.box[2].box[0].height, 128)
|
||||||
self.assertEqual(j.box[2].box[0].width, 128)
|
self.assertEqual(j.box[2].box[0].width, 128)
|
||||||
self.assertEqual(j.box[2].box[0].num_components, 2)
|
self.assertEqual(j.box[2].box[0].num_components, 2)
|
||||||
self.assertEqual(j.box[2].box[1].color_space,
|
self.assertEqual(j.box[2].box[1].colorspace,
|
||||||
glymur.core.GREYSCALE)
|
glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_grey_with_two_extra_components(self):
|
def test_grey_with_two_extra_components(self):
|
||||||
|
|
@ -407,7 +407,7 @@ class TestJp2k(unittest.TestCase):
|
||||||
self.assertEqual(j.box[2].box[0].height, 128)
|
self.assertEqual(j.box[2].box[0].height, 128)
|
||||||
self.assertEqual(j.box[2].box[0].width, 128)
|
self.assertEqual(j.box[2].box[0].width, 128)
|
||||||
self.assertEqual(j.box[2].box[0].num_components, 3)
|
self.assertEqual(j.box[2].box[0].num_components, 3)
|
||||||
self.assertEqual(j.box[2].box[1].color_space,
|
self.assertEqual(j.box[2].box[1].colorspace,
|
||||||
glymur.core.GREYSCALE)
|
glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_rgb_with_extra_component(self):
|
def test_rgb_with_extra_component(self):
|
||||||
|
|
@ -418,7 +418,7 @@ class TestJp2k(unittest.TestCase):
|
||||||
self.assertEqual(j.box[2].box[0].height, 128)
|
self.assertEqual(j.box[2].box[0].height, 128)
|
||||||
self.assertEqual(j.box[2].box[0].width, 128)
|
self.assertEqual(j.box[2].box[0].width, 128)
|
||||||
self.assertEqual(j.box[2].box[0].num_components, 4)
|
self.assertEqual(j.box[2].box[0].num_components, 4)
|
||||||
self.assertEqual(j.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(j.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
def test_specify_ycc(self):
|
def test_specify_ycc(self):
|
||||||
# We don't support writing YCC at the moment.
|
# We don't support writing YCC at the moment.
|
||||||
|
|
|
||||||
|
|
@ -3403,7 +3403,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].method, 1)
|
self.assertEqual(jp2.box[3].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact ??
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact ??
|
||||||
self.assertEqual(jp2.box[3].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[3].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
# XML box
|
# XML box
|
||||||
tags = [x.tag for x in jp2.box[4].xml]
|
tags = [x.tag for x in jp2.box[4].xml]
|
||||||
|
|
@ -3445,7 +3445,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact??
|
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact??
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.YCC)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.YCC)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Channel Definition
|
# Channel Definition
|
||||||
|
|
@ -3491,7 +3491,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.YCC)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.YCC)
|
||||||
|
|
||||||
# sub-sampling
|
# sub-sampling
|
||||||
codestream = jp2.get_codestream()
|
codestream = jp2.get_codestream()
|
||||||
|
|
@ -3537,7 +3537,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact?
|
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact?
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.GREYSCALE)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_NR_file5_dump(self):
|
def test_NR_file5_dump(self):
|
||||||
# Three 8-bit components in the ROMM-RGB colourspace, encapsulated in a
|
# Three 8-bit components in the ROMM-RGB colourspace, encapsulated in a
|
||||||
|
|
@ -3580,7 +3580,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 546)
|
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 546)
|
||||||
self.assertIsNone(jp2.box[3].box[1].color_space)
|
self.assertIsNone(jp2.box[3].box[1].colorspace)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Colour specification
|
# Colour specification
|
||||||
|
|
@ -3588,7 +3588,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[2].precedence, 1)
|
self.assertEqual(jp2.box[3].box[2].precedence, 1)
|
||||||
self.assertEqual(jp2.box[3].box[2].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[2].approximation, 1) # JPX exact
|
||||||
self.assertIsNone(jp2.box[3].box[2].icc_profile)
|
self.assertIsNone(jp2.box[3].box[2].icc_profile)
|
||||||
self.assertEqual(jp2.box[3].box[2].color_space,
|
self.assertEqual(jp2.box[3].box[2].colorspace,
|
||||||
glymur.core.ROMM_RGB)
|
glymur.core.ROMM_RGB)
|
||||||
|
|
||||||
def test_NR_file6_dump(self):
|
def test_NR_file6_dump(self):
|
||||||
|
|
@ -3626,7 +3626,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
||||||
self.assertIsNone(jp2.box[2].box[1].icc_profile)
|
self.assertIsNone(jp2.box[2].box[1].icc_profile)
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space,
|
self.assertEqual(jp2.box[2].box[1].colorspace,
|
||||||
glymur.core.GREYSCALE)
|
glymur.core.GREYSCALE)
|
||||||
|
|
||||||
def test_NR_file7_dump(self):
|
def test_NR_file7_dump(self):
|
||||||
|
|
@ -3675,7 +3675,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
self.assertEqual(jp2.box[3].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 13332)
|
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 13332)
|
||||||
self.assertIsNone(jp2.box[3].box[1].color_space)
|
self.assertIsNone(jp2.box[3].box[1].colorspace)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Colour specification
|
# Colour specification
|
||||||
|
|
@ -3683,7 +3683,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[2].precedence, 1)
|
self.assertEqual(jp2.box[3].box[2].precedence, 1)
|
||||||
self.assertEqual(jp2.box[3].box[2].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[2].approximation, 1) # JPX exact
|
||||||
self.assertIsNone(jp2.box[3].box[2].icc_profile)
|
self.assertIsNone(jp2.box[3].box[2].icc_profile)
|
||||||
self.assertEqual(jp2.box[3].box[2].color_space,
|
self.assertEqual(jp2.box[3].box[2].colorspace,
|
||||||
glymur.core.E_SRGB)
|
glymur.core.E_SRGB)
|
||||||
|
|
||||||
def test_NR_file8_dump(self):
|
def test_NR_file8_dump(self):
|
||||||
|
|
@ -3724,7 +3724,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[2].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 414)
|
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 414)
|
||||||
self.assertIsNone(jp2.box[2].box[1].color_space)
|
self.assertIsNone(jp2.box[2].box[1].colorspace)
|
||||||
|
|
||||||
# XML box
|
# XML box
|
||||||
tags = [x.tag for x in jp2.box[3].xml]
|
tags = [x.tag for x in jp2.box[3].xml]
|
||||||
|
|
@ -3796,7 +3796,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[3].precedence, 0)
|
self.assertEqual(jp2.box[2].box[3].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[3].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[2].box[3].approximation, 1) # JPX exact
|
||||||
self.assertIsNone(jp2.box[2].box[3].icc_profile)
|
self.assertIsNone(jp2.box[2].box[3].icc_profile)
|
||||||
self.assertEqual(jp2.box[2].box[3].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[2].box[3].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
def test_NR_00042_j2k_dump(self):
|
def test_NR_00042_j2k_dump(self):
|
||||||
# Profile 3.
|
# Profile 3.
|
||||||
|
|
@ -5272,7 +5272,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # not allowed?
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # not allowed?
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -5405,7 +5405,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -5533,7 +5533,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.YCC)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.YCC)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -5673,7 +5673,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # exact
|
||||||
self.assertEqual(jp2.box[3].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[3].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Palette box.
|
# Palette box.
|
||||||
|
|
@ -5784,7 +5784,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0)
|
self.assertEqual(jp2.box[2].box[1].approximation, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
# Skip the 4th box, it is uknown.
|
# Skip the 4th box, it is uknown.
|
||||||
|
|
||||||
|
|
@ -5884,7 +5884,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].method, 1) # ICC
|
self.assertEqual(jp2.box[3].box[1].method, 1) # ICC
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(jp2.box[3].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[3].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
c = jp2.box[4].main_header
|
c = jp2.box[4].main_header
|
||||||
|
|
||||||
|
|
@ -5981,7 +5981,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.GREYSCALE)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.GREYSCALE)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Channel Definition
|
# Channel Definition
|
||||||
|
|
@ -6100,7 +6100,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(jp2.box[3].box[1].color_space, glymur.core.CMYK)
|
self.assertEqual(jp2.box[3].box[1].colorspace, glymur.core.CMYK)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Palette box.
|
# Palette box.
|
||||||
|
|
@ -6214,7 +6214,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
self.assertEqual(jp2.box[3].box[1].method, 1) # enumerated
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(jp2.box[3].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[3].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
# Jp2 Header
|
# Jp2 Header
|
||||||
# Palette box.
|
# Palette box.
|
||||||
|
|
@ -6322,7 +6322,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].method, 1)
|
self.assertEqual(jp2.box[2].box[1].method, 1)
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.YCC)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.YCC)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -6427,7 +6427,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 1)
|
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 1)
|
||||||
self.assertIsNone(jp2.box[2].box[1].color_space)
|
self.assertIsNone(jp2.box[2].box[1].colorspace)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -6523,7 +6523,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
self.assertEqual(jp2.box[2].box[1].approximation, 0) # JP2
|
||||||
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 1)
|
self.assertEqual(len(jp2.box[2].box[1].icc_profile), 1)
|
||||||
self.assertIsNone(jp2.box[2].box[1].color_space)
|
self.assertIsNone(jp2.box[2].box[1].colorspace)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
@ -6625,7 +6625,7 @@ class TestSuite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
self.assertEqual(jp2.box[3].box[1].precedence, 2)
|
||||||
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
self.assertEqual(jp2.box[3].box[1].approximation, 1) # JPX exact
|
||||||
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 1328)
|
self.assertEqual(len(jp2.box[3].box[1].icc_profile), 1328)
|
||||||
self.assertIsNone(jp2.box[3].box[1].color_space)
|
self.assertIsNone(jp2.box[3].box[1].colorspace)
|
||||||
|
|
||||||
# UUID boxes. All mentioned in the RREQ box.
|
# UUID boxes. All mentioned in the RREQ box.
|
||||||
self.assertEqual(jp2.box[2].vendor_feature[0], jp2.box[4].uuid)
|
self.assertEqual(jp2.box[2].vendor_feature[0], jp2.box[4].uuid)
|
||||||
|
|
|
||||||
|
|
@ -693,7 +693,7 @@ class TestSuiteWrite(unittest.TestCase):
|
||||||
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
self.assertEqual(jp2.box[2].box[1].precedence, 0)
|
||||||
self.assertEqual(jp2.box[2].box[1].approximation, 0)
|
self.assertEqual(jp2.box[2].box[1].approximation, 0)
|
||||||
self.assertIsNone(jp2.box[2].box[1].icc_profile)
|
self.assertIsNone(jp2.box[2].box[1].icc_profile)
|
||||||
self.assertEqual(jp2.box[2].box[1].color_space, glymur.core.SRGB)
|
self.assertEqual(jp2.box[2].box[1].colorspace, glymur.core.SRGB)
|
||||||
|
|
||||||
c = jp2.box[3].main_header
|
c = jp2.box[3].main_header
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,7 @@ class TestPrinting(unittest.TestCase):
|
||||||
|
|
||||||
# Now append the codestream.
|
# Now append the codestream.
|
||||||
tfile2.write(codestream)
|
tfile2.write(codestream)
|
||||||
|
tfile2.flush()
|
||||||
|
|
||||||
jasoc = glymur.Jp2k(tfile2.name)
|
jasoc = glymur.Jp2k(tfile2.name)
|
||||||
print(jasoc.box[3])
|
print(jasoc.box[3])
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -1,7 +1,7 @@
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
kwargs = {'name': 'Glymur',
|
kwargs = {'name': 'Glymur',
|
||||||
'version': '0.1.4',
|
'version': '0.1.5',
|
||||||
'description': 'Tools for accessing JPEG2000 files',
|
'description': 'Tools for accessing JPEG2000 files',
|
||||||
'long_description': open('README.md').read(),
|
'long_description': open('README.md').read(),
|
||||||
'author': 'John Evans',
|
'author': 'John Evans',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue