diff --git a/glymur/jp2k.py b/glymur/jp2k.py index 15d4123..e098ce9 100644 --- a/glymur/jp2k.py +++ b/glymur/jp2k.py @@ -883,7 +883,7 @@ class Jp2k(Jp2kBox): dparam.nb_tile_to_decode = 1 with ExitStack() as stack: - if hasattr(_opj2.OPENJPEG, 'opj_stream_create_default_file_stream_v3'): + if hasattr(_opj2.OPENJP2, 'opj_stream_create_default_file_stream_v3'): stream = _opj2.stream_create_default_file_stream_v3(self.filename, True) stack.callback(_opj2.stream_destroy_v3, stream) diff --git a/glymur/test/test_opj_suite.py b/glymur/test/test_opj_suite.py index 47d50f8..094680d 100644 --- a/glymur/test/test_opj_suite.py +++ b/glymur/test/test_opj_suite.py @@ -30,6 +30,11 @@ import numpy as np from glymur import Jp2k import glymur +OPENJP2_IS_V2_OFFICIAL=False +if glymur.lib.openjp2.OPENJP2 is not None: + if not hasattr(glymur.lib.openjp2.OPENJP2, 'opj_stream_create_default_file_stream_v3'): + OPENJP2_IS_V2_OFFICIAL=True + from .fixtures import * try: @@ -1056,6 +1061,8 @@ class TestSuite(unittest.TestCase): with self.assertRaises(IOError): data = j.read() + @unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, + "Test not in done in v2.0.0 official") def test_NR_DEC_gdal_fuzzer_check_number_of_tiles_jp2_38_decode(self): relpath = 'input/nonregression/gdal_fuzzer_check_number_of_tiles.jp2' jfile = os.path.join(data_root, relpath) @@ -1065,6 +1072,8 @@ class TestSuite(unittest.TestCase): with self.assertRaises(IOError): data = j.read() + @unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, + "Test not in done in v2.0.0 official") def test_NR_DEC_gdal_fuzzer_check_comp_dx_dy_jp2_39_decode(self): relpath = 'input/nonregression/gdal_fuzzer_check_comp_dx_dy.jp2' jfile = os.path.join(data_root, relpath)