diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index edefb7f..8e4a74c 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -679,6 +679,9 @@ class TestJp2k15(unittest.TestCase): j2k.read(layer=1) @unittest.skipIf(os.name == "nt", "NamedTemporaryFile issue on windows") + @unittest.skipIf(re.match(r"""1\.[01234]\.\d""", + OPENJPEG_VERSION) is not None, + "Writing only supported with openjpeg version 1.5+.") def test_2d_rgb(self): """RGB must have at least 3 components.""" with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile: diff --git a/glymur/test/test_opj_suite_write.py b/glymur/test/test_opj_suite_write.py index 479cb1f..e187d34 100644 --- a/glymur/test/test_opj_suite_write.py +++ b/glymur/test/test_opj_suite_write.py @@ -10,6 +10,7 @@ suite. # pylint: disable=F0401 import os +import re import sys import tempfile @@ -19,15 +20,16 @@ else: import unittest from .fixtures import read_image, NO_READ_BACKEND, NO_READ_BACKEND_MSG -from .fixtures import OPJ_DATA_ROOT, opj_data_file +from .fixtures import OPJ_DATA_ROOT, OPENJPEG_VERSION, opj_data_file from glymur import Jp2k import glymur @unittest.skipIf(os.name == "nt", "no write support on windows, period") -@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None, - "Missing openjp2 library.") +@unittest.skipIf(re.match(r"""1\.[01234]\.\d""", + OPENJPEG_VERSION) is not None, + "Writing only supported with openjpeg version 1.5+.") @unittest.skipIf(NO_READ_BACKEND, NO_READ_BACKEND_MSG) @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_DATA_ROOT environment variable not set")