First full run through successful with v2.0.0 official, with write support. #90

This commit is contained in:
John Evans 2013-07-29 09:54:04 -04:00
commit c2a94b92f1
7 changed files with 95 additions and 3 deletions

View file

@ -5,6 +5,7 @@ Wraps individual functions in openjp2 library.
# pylint: disable=C0302,R0903
import ctypes
import sys
from .config import glymur_config
OPENJP2, OPENJPEG = glymur_config()
@ -1382,3 +1383,13 @@ def set_error_message(msg):
"""The openjpeg error handler has recorded an error message."""
global ERROR_MSG_LST
ERROR_MSG_LST.append(msg)
def version():
"""Wrapper for opj_version library routine."""
OPENJP2.opj_version.restype = ctypes.c_char_p
library_version = OPENJP2.opj_version()
if sys.hexversion >= 0x03000000:
return library_version.decode('utf-8')
else:
return library_version

View file

@ -16,10 +16,15 @@ import numpy as np
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
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
@unittest.skipIf(glymur.lib._openjp2.OPENJP2 is None,
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None,
"Missing openjp2 library.")
@unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, "API followed here specific to V2.0+")
class TestOpenJP2(unittest.TestCase):
def setUp(self):