Merge branch 'master' into devel
This commit is contained in:
commit
0c8d5134cd
7 changed files with 49 additions and 80 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
Jul 24, 2013 - v0.2.6 No longer warning when configuration file not found.
|
||||||
|
Added read support for jpch, jplh boxes. Added testing of files in
|
||||||
|
format-corpus repository.
|
||||||
|
|
||||||
Jul 23, 2013 - v0.2.5 Fixed inconsistency in XML handling, now all instances
|
Jul 23, 2013 - v0.2.5 Fixed inconsistency in XML handling, now all instances
|
||||||
are always ElementTree objects (issue82).
|
are always ElementTree objects (issue82).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,9 @@ copyright = u'2013, John Evans'
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '0.1'
|
version = '0.2'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '0.2.5'
|
release = '0.2.6'
|
||||||
|
|
||||||
# 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.
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,6 @@ def glymurrc_fname():
|
||||||
fname = os.path.join(confdir, 'glymurrc')
|
fname = os.path.join(confdir, 'glymurrc')
|
||||||
if os.path.exists(fname):
|
if os.path.exists(fname):
|
||||||
return fname
|
return fname
|
||||||
else:
|
|
||||||
msg = "Configuration directory '{0}' does not exist.".format(fname)
|
|
||||||
warnings.warn(msg)
|
|
||||||
|
|
||||||
# didn't find a configuration file.
|
# didn't find a configuration file.
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -81,40 +81,5 @@ class TestSuite(unittest.TestCase):
|
||||||
with self.assertWarns(UserWarning) as cw:
|
with self.assertWarns(UserWarning) as cw:
|
||||||
imp.reload(glymur.lib.openjp2)
|
imp.reload(glymur.lib.openjp2)
|
||||||
|
|
||||||
def test_missing_config_file_via_environ(self):
|
|
||||||
# Verify that we error out properly if the configuration file
|
|
||||||
# specified via environment variable is not found.
|
|
||||||
with tempfile.TemporaryDirectory() as tdir:
|
|
||||||
with patch.dict('os.environ', {'XDG_CONFIG_HOME': tdir}):
|
|
||||||
# Misconfigured new configuration file should
|
|
||||||
# be rejected.
|
|
||||||
with self.assertWarns(UserWarning) as cw:
|
|
||||||
imp.reload(glymur.lib.openjp2)
|
|
||||||
|
|
||||||
def test_home_dir_missing_config_dir(self):
|
|
||||||
# Verify no exception is raised if $HOME is missing .config directory.
|
|
||||||
with tempfile.TemporaryDirectory() as tdir:
|
|
||||||
with patch.dict('os.environ', {'HOME': tdir}):
|
|
||||||
# Misconfigured new configuration file should
|
|
||||||
# be rejected.
|
|
||||||
with self.assertWarns(UserWarning) as cw:
|
|
||||||
imp.reload(glymur.lib.openjp2)
|
|
||||||
|
|
||||||
def test_home_dir_missing_glymur_rc_dir(self):
|
|
||||||
# Should warn but not error if $HOME/.config but no glymurrc dir.
|
|
||||||
with tempfile.TemporaryDirectory() as tdir:
|
|
||||||
# We need the subdirectory to be specifically named as ".config"
|
|
||||||
# in order for this test to work. A specifically-named temporary
|
|
||||||
# directory does not seem to be possible, so try to symlink it.
|
|
||||||
# Supposedly the symlink gets cleaned up with tdir gets cleaned up.
|
|
||||||
with tempfile.TemporaryDirectory(suffix=".config", dir=tdir) \
|
|
||||||
as tdir_config:
|
|
||||||
os.symlink(tdir_config, os.path.join(tdir, '.config'))
|
|
||||||
with patch.dict('os.environ', {'HOME': tdir}):
|
|
||||||
# Misconfigured new configuration file should
|
|
||||||
# be rejected.
|
|
||||||
with self.assertWarns(UserWarning) as cw:
|
|
||||||
imp.reload(glymur.lib.openjp2)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
|
|
@ -472,7 +472,7 @@ class TestColourSpecificationBox(unittest.TestCase):
|
||||||
|
|
||||||
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None,
|
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None,
|
||||||
"Missing openjp2 library.")
|
"Missing openjp2 library.")
|
||||||
class TestJp2Boxes(unittest.TestCase):
|
class TestWrap(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.j2kfile = glymur.data.goodstuff()
|
self.j2kfile = glymur.data.goodstuff()
|
||||||
|
|
@ -481,39 +481,6 @@ class TestJp2Boxes(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_default_JPEG2000SignatureBox(self):
|
|
||||||
# Should be able to instantiate a JPEG2000SignatureBox
|
|
||||||
b = glymur.jp2box.JPEG2000SignatureBox()
|
|
||||||
self.assertEqual(b.signature, (13, 10, 135, 10))
|
|
||||||
|
|
||||||
def test_default_FileTypeBox(self):
|
|
||||||
# Should be able to instantiate a FileTypeBox
|
|
||||||
b = glymur.jp2box.FileTypeBox()
|
|
||||||
self.assertEqual(b.brand, 'jp2 ')
|
|
||||||
self.assertEqual(b.minor_version, 0)
|
|
||||||
self.assertEqual(b.compatibility_list, ['jp2 '])
|
|
||||||
|
|
||||||
def test_default_ImageHeaderBox(self):
|
|
||||||
# Should be able to instantiate an image header box.
|
|
||||||
b = glymur.jp2box.ImageHeaderBox(height=512, width=256,
|
|
||||||
num_components=3)
|
|
||||||
self.assertEqual(b.height, 512)
|
|
||||||
self.assertEqual(b.width, 256)
|
|
||||||
self.assertEqual(b.num_components, 3)
|
|
||||||
self.assertEqual(b.bits_per_component, 8)
|
|
||||||
self.assertFalse(b.signed)
|
|
||||||
self.assertFalse(b.colorspace_unknown)
|
|
||||||
|
|
||||||
def test_default_JP2HeaderBox(self):
|
|
||||||
b1 = JP2HeaderBox()
|
|
||||||
b1.box = [ImageHeaderBox(height=512, width=256),
|
|
||||||
ColourSpecificationBox(colorspace=glymur.core.GREYSCALE)]
|
|
||||||
|
|
||||||
def test_default_ContiguousCodestreamBox(self):
|
|
||||||
b = ContiguousCodestreamBox()
|
|
||||||
self.assertEqual(b.box_id, 'jp2c')
|
|
||||||
self.assertIsNone(b.main_header)
|
|
||||||
|
|
||||||
def verify_wrapped_raw(self, jp2file):
|
def verify_wrapped_raw(self, jp2file):
|
||||||
# Shared method by at least two tests.
|
# Shared method by at least two tests.
|
||||||
jp2 = Jp2k(jp2file)
|
jp2 = Jp2k(jp2file)
|
||||||
|
|
@ -679,6 +646,42 @@ class TestJp2Boxes(unittest.TestCase):
|
||||||
j2k.wrap(tfile.name, boxes=boxes)
|
j2k.wrap(tfile.name, boxes=boxes)
|
||||||
|
|
||||||
|
|
||||||
|
class TestJp2Boxes(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_default_JPEG2000SignatureBox(self):
|
||||||
|
# Should be able to instantiate a JPEG2000SignatureBox
|
||||||
|
b = glymur.jp2box.JPEG2000SignatureBox()
|
||||||
|
self.assertEqual(b.signature, (13, 10, 135, 10))
|
||||||
|
|
||||||
|
def test_default_FileTypeBox(self):
|
||||||
|
# Should be able to instantiate a FileTypeBox
|
||||||
|
b = glymur.jp2box.FileTypeBox()
|
||||||
|
self.assertEqual(b.brand, 'jp2 ')
|
||||||
|
self.assertEqual(b.minor_version, 0)
|
||||||
|
self.assertEqual(b.compatibility_list, ['jp2 '])
|
||||||
|
|
||||||
|
def test_default_ImageHeaderBox(self):
|
||||||
|
# Should be able to instantiate an image header box.
|
||||||
|
b = glymur.jp2box.ImageHeaderBox(height=512, width=256,
|
||||||
|
num_components=3)
|
||||||
|
self.assertEqual(b.height, 512)
|
||||||
|
self.assertEqual(b.width, 256)
|
||||||
|
self.assertEqual(b.num_components, 3)
|
||||||
|
self.assertEqual(b.bits_per_component, 8)
|
||||||
|
self.assertFalse(b.signed)
|
||||||
|
self.assertFalse(b.colorspace_unknown)
|
||||||
|
|
||||||
|
def test_default_JP2HeaderBox(self):
|
||||||
|
b1 = JP2HeaderBox()
|
||||||
|
b1.box = [ImageHeaderBox(height=512, width=256),
|
||||||
|
ColourSpecificationBox(colorspace=glymur.core.GREYSCALE)]
|
||||||
|
|
||||||
|
def test_default_ContiguousCodestreamBox(self):
|
||||||
|
b = ContiguousCodestreamBox()
|
||||||
|
self.assertEqual(b.box_id, 'jp2c')
|
||||||
|
self.assertIsNone(b.main_header)
|
||||||
|
|
||||||
|
|
||||||
class TestJpxBoxes(unittest.TestCase):
|
class TestJpxBoxes(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
||||||
10
release.txt
10
release.txt
|
|
@ -6,15 +6,15 @@
|
||||||
| | | | | pass. |
|
| | | | | pass. |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
| Mac | X | | | MacPorts with both OpenJPEG 1.5.1 |
|
| Mac | X | | | MacPorts with both OpenJPEG 1.5.1 |
|
||||||
| 10.6.8 | | | | and OpenJPEG svn. 352 of 450 tests |
|
| 10.6.8 | | | | and OpenJPEG svn. 354 of 455 tests |
|
||||||
| | | | | should pass. |
|
| | | | | should pass. |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
| Mac | | X | | MacPorts with both OpenJPEG 1.5.1 |
|
| Mac | | X | | MacPorts with both OpenJPEG 1.5.1 |
|
||||||
| 10.6.8 | | | | and OpenJPEG svn. 377 of 455 tests |
|
| 10.6.8 | | | | and OpenJPEG svn. 379 of 460 tests |
|
||||||
| | | | | should pass. |
|
| | | | | should pass. |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
| Mac | | | X | MacPorts with both OpenJPEG 1.5.1 |
|
| Mac | | | X | MacPorts with both OpenJPEG 1.5.1 |
|
||||||
| 10.6.8 | | | | and OpenJPEG svn. 402 of 455 |
|
| 10.6.8 | | | | and OpenJPEG svn. 407 of 460 |
|
||||||
| | | | | tests should pass. |
|
| | | | | tests should pass. |
|
||||||
+-----------+--------+--------+-----------------------------------------------+
|
+-----------+--------+--------+-----------------------------------------------+
|
||||||
| Fedora 19 | | | X | Ships with 1.5.1, openjp2 built too. |
|
| Fedora 19 | | | X | Ships with 1.5.1, openjp2 built too. |
|
||||||
|
|
@ -26,10 +26,10 @@
|
||||||
| Fedora 17 | | X | | Ships with 1.4.0. 166 of 450 tests |
|
| Fedora 17 | | X | | Ships with 1.4.0. 166 of 450 tests |
|
||||||
| | | | | should pass. |
|
| | | | | should pass. |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
| CentOS | X | | | Ships with 1.3.0. 164 of 450 tests |
|
| CentOS | X | | | Ships with 1.3.0. 169 of 455 tests |
|
||||||
| 6.3 | | | | should pass. |
|
| 6.3 | | | | should pass. |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
| Raspberry | | X | | Ships with 1.3.0. 166 of 450 tests |
|
| Raspberry | | X | | Ships with 1.3.0. 171 of 455 tests |
|
||||||
| Pi | | | | should pass. |
|
| Pi | | | | should pass. |
|
||||||
| Debian 7 | | | | |
|
| Debian 7 | | | | |
|
||||||
+-----------+--------+--------+--------+--------------------------------------+
|
+-----------+--------+--------+--------+--------------------------------------+
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
kwargs = {'name': 'Glymur',
|
kwargs = {'name': 'Glymur',
|
||||||
'version': '0.2.5',
|
'version': '0.2.6',
|
||||||
'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