251 lines
7.9 KiB
Diff
251 lines
7.9 KiB
Diff
diff --git a/imagecodecs/_cms.pyx b/imagecodecs/_cms.pyx
|
|
index 37f9f12..dc3e778 100644
|
|
--- a/imagecodecs/_cms.pyx
|
|
+++ b/imagecodecs/_cms.pyx
|
|
@@ -942,5 +942,5 @@ cdef void _cms_log_error_handler(
|
|
cmsContext ContextID,
|
|
cmsUInt32Number ErrorCode,
|
|
const char *Text
|
|
-) with gil:
|
|
- _log_warning('CMS error: %s', Text.decode().strip())
|
|
\ No newline at end of file
|
|
+) noexcept with gil:
|
|
+ _log_warning('CMS error: %s', Text.decode().strip())
|
|
diff --git a/imagecodecs/_gif.pyx b/imagecodecs/_gif.pyx
|
|
index 82f023f..000c5bb 100644
|
|
--- a/imagecodecs/_gif.pyx
|
|
+++ b/imagecodecs/_gif.pyx
|
|
@@ -489,7 +489,7 @@ cdef int gif_input_func(
|
|
GifFileType* gif,
|
|
GifByteType* dst,
|
|
int size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""GIF read callback function."""
|
|
cdef:
|
|
memgif_t* memgif = <memgif_t*> gif.UserData
|
|
@@ -514,7 +514,7 @@ cdef int gif_output_func(
|
|
GifFileType* gif,
|
|
const GifByteType* src,
|
|
int size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""GIF write callback function."""
|
|
cdef:
|
|
memgif_t* memgif = <memgif_t*> gif.UserData
|
|
diff --git a/imagecodecs/_heif.pyx b/imagecodecs/_heif.pyx
|
|
index 408e36c..41acb6d 100644
|
|
--- a/imagecodecs/_heif.pyx
|
|
+++ b/imagecodecs/_heif.pyx
|
|
@@ -771,7 +771,7 @@ cdef heif_error heif_write_callback(
|
|
const void* data,
|
|
size_t size,
|
|
void* userdata
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""heif_writer callback function."""
|
|
cdef:
|
|
output_t* output = <output_t*> userdata
|
|
diff --git a/imagecodecs/_jpeg8.pyx b/imagecodecs/_jpeg8.pyx
|
|
index 19b1ce8..5f8bc4e 100644
|
|
--- a/imagecodecs/_jpeg8.pyx
|
|
+++ b/imagecodecs/_jpeg8.pyx
|
|
@@ -393,14 +393,14 @@ ctypedef struct my_error_mgr:
|
|
jmp_buf setjmp_buffer
|
|
|
|
|
|
-cdef void my_error_exit(jpeg_common_struct* cinfo) nogil:
|
|
+cdef void my_error_exit(jpeg_common_struct* cinfo) noexcept nogil:
|
|
cdef:
|
|
my_error_mgr* error = <my_error_mgr*> deref(cinfo).err
|
|
|
|
longjmp(deref(error).setjmp_buffer, 1)
|
|
|
|
|
|
-cdef void my_output_message(jpeg_common_struct* cinfo) nogil:
|
|
+cdef void my_output_message(jpeg_common_struct* cinfo) noexcept nogil:
|
|
pass
|
|
|
|
|
|
diff --git a/imagecodecs/_jpegxr.pyx b/imagecodecs/_jpegxr.pyx
|
|
index 548fcdf..b0cb11f 100644
|
|
--- a/imagecodecs/_jpegxr.pyx
|
|
+++ b/imagecodecs/_jpegxr.pyx
|
|
@@ -378,7 +378,7 @@ def jpegxr_decode(data, index=None, fp2int=False, numthreads=None, out=None):
|
|
return out
|
|
|
|
|
|
-cdef ERR WriteWS_Memory(WMPStream* pWS, const void* pv, size_t cb) nogil:
|
|
+cdef ERR WriteWS_Memory(WMPStream* pWS, const void* pv, size_t cb) noexcept nogil:
|
|
"""Relpacement for WriteWS_Memory to keep track of bytes written."""
|
|
if pWS.state.buf.cbCur + cb < pWS.state.buf.cbCur:
|
|
return WMP_errBufferOverflow
|
|
@@ -395,7 +395,7 @@ cdef ERR WriteWS_Memory(WMPStream* pWS, const void* pv, size_t cb) nogil:
|
|
return WMP_errSuccess
|
|
|
|
|
|
-cdef ERR WriteWS_Realloc(WMPStream* pWS, const void* pv, size_t cb) nogil:
|
|
+cdef ERR WriteWS_Realloc(WMPStream* pWS, const void* pv, size_t cb) noexcept nogil:
|
|
"""Relpacement for WriteWS_Memory to realloc buffers on overflow.
|
|
|
|
Only use with buffers allocated by malloc.
|
|
@@ -431,7 +431,7 @@ cdef ERR WriteWS_Realloc(WMPStream* pWS, const void* pv, size_t cb) nogil:
|
|
return WMP_errSuccess
|
|
|
|
|
|
-cdef Bool EOSWS_Realloc(WMPStream* pWS) nogil:
|
|
+cdef Bool EOSWS_Realloc(WMPStream* pWS) noexcept nogil:
|
|
"""Relpacement for EOSWS_Memory."""
|
|
# return pWS.state.buf.cbBuf <= pWS.state.buf.cbCur
|
|
return 1
|
|
diff --git a/imagecodecs/_png.pyx b/imagecodecs/_png.pyx
|
|
index ce2b597..bdb0f23 100644
|
|
--- a/imagecodecs/_png.pyx
|
|
+++ b/imagecodecs/_png.pyx
|
|
@@ -328,14 +328,14 @@ def png_decode(data, index=None, numthreads=None, out=None):
|
|
cdef void png_error_callback(
|
|
png_structp png_ptr,
|
|
png_const_charp msg
|
|
-) with gil:
|
|
+) noexcept with gil:
|
|
raise PngError(msg.decode().strip())
|
|
|
|
|
|
cdef void png_warn_callback(
|
|
png_structp png_ptr,
|
|
png_const_charp msg
|
|
-) with gil:
|
|
+) noexcept with gil:
|
|
_log_warning('PNG warning: %s', msg.decode().strip())
|
|
|
|
|
|
@@ -350,7 +350,7 @@ cdef void png_read_data_fn(
|
|
png_structp png_ptr,
|
|
png_bytep dst,
|
|
png_size_t size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""PNG read callback function."""
|
|
cdef:
|
|
mempng_t* mempng = <mempng_t*> png_get_io_ptr(png_ptr)
|
|
@@ -373,7 +373,7 @@ cdef void png_write_data_fn(
|
|
png_structp png_ptr,
|
|
png_bytep src,
|
|
png_size_t size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""PNG write callback function."""
|
|
cdef:
|
|
mempng_t* mempng = <mempng_t*> png_get_io_ptr(png_ptr)
|
|
@@ -404,7 +404,7 @@ cdef void png_write_data_fn(
|
|
mempng.offset += size
|
|
|
|
|
|
-cdef void png_output_flush_fn(png_structp png_ptr) nogil:
|
|
+cdef void png_output_flush_fn(png_structp png_ptr) noexcept nogil:
|
|
"""PNG flush callback function."""
|
|
pass
|
|
|
|
diff --git a/imagecodecs/_tiff.pyx b/imagecodecs/_tiff.pyx
|
|
index 488e8f5..32fc847 100644
|
|
--- a/imagecodecs/_tiff.pyx
|
|
+++ b/imagecodecs/_tiff.pyx
|
|
@@ -821,7 +821,7 @@ cdef memtif_t* memtif_open(
|
|
return memtif
|
|
|
|
|
|
-cdef memtif_t* memtif_new(toff_t size, toff_t inc) nogil:
|
|
+cdef memtif_t* memtif_new(toff_t size, toff_t inc) noexcept nogil:
|
|
"""Return new memtif with new buffer for writing."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> malloc(sizeof(memtif_t))
|
|
@@ -842,7 +842,7 @@ cdef memtif_t* memtif_new(toff_t size, toff_t inc) nogil:
|
|
return memtif
|
|
|
|
|
|
-cdef void memtif_del(memtif_t* memtif) nogil:
|
|
+cdef void memtif_del(memtif_t* memtif) noexcept nogil:
|
|
"""Delete memtif."""
|
|
if memtif != NULL:
|
|
if memtif.owner:
|
|
@@ -854,7 +854,7 @@ cdef tsize_t memtif_TIFFReadProc(
|
|
thandle_t handle,
|
|
void* buf,
|
|
tmsize_t size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to read from memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -870,7 +870,7 @@ cdef tmsize_t memtif_TIFFWriteProc(
|
|
thandle_t handle,
|
|
void* buf,
|
|
tmsize_t size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to write to memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -897,7 +897,7 @@ cdef toff_t memtif_TIFFSeekProc(
|
|
thandle_t handle,
|
|
toff_t off,
|
|
int whence
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to seek to memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -946,7 +946,7 @@ cdef toff_t memtif_TIFFSeekProc(
|
|
return memtif.fpos
|
|
|
|
|
|
-cdef int memtif_TIFFCloseProc(thandle_t handle) nogil:
|
|
+cdef int memtif_TIFFCloseProc(thandle_t handle) noexcept nogil:
|
|
"""Callback function to close memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -955,7 +955,7 @@ cdef int memtif_TIFFCloseProc(thandle_t handle) nogil:
|
|
return 0
|
|
|
|
|
|
-cdef toff_t memtif_TIFFSizeProc(thandle_t handle) nogil:
|
|
+cdef toff_t memtif_TIFFSizeProc(thandle_t handle) noexcept nogil:
|
|
"""Callback function to return size of memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -967,7 +967,7 @@ cdef int memtif_TIFFMapFileProc(
|
|
thandle_t handle,
|
|
void** base,
|
|
toff_t* size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to map memtif."""
|
|
cdef:
|
|
memtif_t* memtif = <memtif_t*> handle
|
|
@@ -981,7 +981,7 @@ cdef void memtif_TIFFUnmapFileProc(
|
|
thandle_t handle,
|
|
void* base,
|
|
toff_t size
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to unmap memtif."""
|
|
return
|
|
|
|
@@ -991,7 +991,7 @@ cdef void tif_error_handler(
|
|
const char* module,
|
|
const char* fmt,
|
|
va_list args
|
|
-) nogil:
|
|
+) noexcept nogil:
|
|
"""Callback function to write libtiff error message to memtif."""
|
|
cdef:
|
|
memtif_t* memtif
|
|
@@ -1010,7 +1010,7 @@ cdef void tif_warning_handler(
|
|
const char* module,
|
|
const char* fmt,
|
|
va_list args
|
|
-) with gil:
|
|
+) noexcept with gil:
|
|
"""Callback function to output libtiff warning message to logging."""
|
|
cdef:
|
|
char msg[80]
|