Merge branch 'devel' of https://github.com/quintusdias/glymur into devel

This commit is contained in:
jevans 2014-05-25 21:45:29 -04:00
commit 5311eb731b

View file

@ -854,6 +854,23 @@ class TestJp2kOpjDataRootWarnings(unittest.TestCase):
class TestJp2kOpjDataRoot(unittest.TestCase):
"""These tests should be run by just about all configuration."""
@unittest.skipIf(os.name == "nt", "NamedTemporaryFile issue on windows")
def test_irreversible(self):
"""Irreversible"""
filename = opj_data_file('input/nonregression/issue141.rawl')
expdata = np.fromfile(filename, dtype=np.uint16)
expdata.resize((2816, 2048))
with tempfile.NamedTemporaryFile(suffix='.j2k') as tfile:
j = Jp2k(tfile.name, 'wb')
j.write(expdata, irreversible=True)
codestream = j.get_codestream()
self.assertEqual(codestream.segment[2].spcod[8],
glymur.core.WAVELET_XFORM_9X7_IRREVERSIBLE)
actdata = j.read()
self.assertTrue(fixtures.mse(actdata, expdata) < 250)
def test_no_cxform_pclr_jp2(self):
"""Indices for pclr jpxfile if no color transform"""
filename = opj_data_file('input/conformance/file9.jp2')