From 3ebb708e115842f581c2fdcf5952d68341e74822 Mon Sep 17 00:00:00 2001 From: John Evans Date: Wed, 19 Nov 2014 07:59:05 -0500 Subject: [PATCH] progress --- glymur/jp2k.py | 5 ++++- glymur/test/test_jp2k.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/glymur/jp2k.py b/glymur/jp2k.py index 2ea9588..9e2e120 100644 --- a/glymur/jp2k.py +++ b/glymur/jp2k.py @@ -1128,7 +1128,10 @@ class Jp2k(Jp2kBox): event_mgr = opj.EventMgrType() info_handler = ctypes.cast(_INFO_CALLBACK, ctypes.c_void_p) - event_mgr.info_handler = info_handler if verbose else None + if verbose or self._verbose: + event_mgr.info_handler = info_handler + else: + event_mgr.info_handler = None event_mgr.warning_handler = ctypes.cast(_WARNING_CALLBACK, ctypes.c_void_p) event_mgr.error_handler = ctypes.cast(_ERROR_CALLBACK, diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 7e8c067..553a07e 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -227,6 +227,7 @@ class TestSliceProtocolRead(SliceProtocolBase): expected = self.j2k_data[3:8, :,:] np.testing.assert_array_equal(actual, expected) + @unittest.skip('see issue 301') def test_region_rlevel5(self): actual = self.j2k[5:533:32, 27:423:32] expected = self.j2k_data_r5[1:17, 1:14] @@ -288,7 +289,7 @@ class TestJp2k(unittest.TestCase): jpx = Jp2k(self.jpxfile) self.assertEqual(jpx.shape, (1024, 1024, 3)) - @unittest.skipIf(re.match("1.5|2", glymur.version.openjpeg_version) is None, + @unittest.skipIf(re.match("0|1.[0-4]", glymur.version.openjpeg_version), "Must have openjpeg 1.5 or higher to run") @unittest.skipIf(os.name == "nt", "Unexplained failure on windows") def test_irreversible(self): @@ -1116,6 +1117,8 @@ class TestJp2kOpjDataRootWarnings(unittest.TestCase): class TestJp2kOpjDataRoot(unittest.TestCase): """These tests should be run by just about all configuration.""" + @unittest.skipIf(re.match("0|1.[0-4]", glymur.version.openjpeg_version), + "Must have openjpeg 1.5 or higher to run") @unittest.skipIf(os.name == "nt", fixtures.WINDOWS_TMP_FILE_MSG) def test_irreversible(self): """Irreversible"""