Using existing openjp2 handlers for now. #112
Seems a little greasy, but it works. Probably should think about a separate error handler, though.
This commit is contained in:
parent
8292b7cf40
commit
cc10537c14
3 changed files with 53 additions and 43 deletions
|
|
@ -685,7 +685,7 @@ def check_error(status):
|
|||
raise IOError("OpenJPEG function failure.")
|
||||
|
||||
# These library functions all return an error status. Circumvent that and
|
||||
# force # them to raise an exception.
|
||||
# force them to raise an exception.
|
||||
FCNS = ['opj_decode', 'opj_decode_tile_data', 'opj_end_compress',
|
||||
'opj_encode', 'opj_end_decompress', 'opj_get_decoded_tile',
|
||||
'opj_read_header', 'opj_read_tile_header', 'opj_set_decode_area',
|
||||
|
|
|
|||
|
|
@ -527,8 +527,7 @@ def encode(cinfo, cio, image):
|
|||
OPENJPEG.opj_encode.argtypes = argtypes
|
||||
OPENJPEG.opj_encode.restype = ctypes.c_int
|
||||
status = OPENJPEG.opj_encode(cinfo, cio, image)
|
||||
if not status:
|
||||
raise RuntimeError("opj_encode failed")
|
||||
return status
|
||||
|
||||
|
||||
def destroy_decompress(dinfo):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue