python-imagecodecs/python-imagecodecs-noexcept.patch
Orion Poplawski 422d0bdfff Update to 2023.1.23
Add more test dependencies

We also need a rebuild for blosc2-2.14.4 which changes the SONAME of
libblosc2, which this update handles.
2024-04-21 21:34:14 +02:00

248 lines
9 KiB
Diff

diff -up imagecodecs-2023.1.23/imagecodecs/_cms.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_cms.pyx
--- imagecodecs-2023.1.23/imagecodecs/_cms.pyx.noexcept 2022-12-29 13:17:33.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_cms.pyx 2024-02-04 14:46:24.874770321 -0700
@@ -956,5 +956,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 -up imagecodecs-2023.1.23/imagecodecs/_gif.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_gif.pyx
--- imagecodecs-2023.1.23/imagecodecs/_gif.pyx.noexcept 2022-12-29 13:17:33.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_gif.pyx 2024-02-04 15:39:31.174619739 -0700
@@ -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 -up imagecodecs-2023.1.23/imagecodecs/_gif.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_gif.pyx
--- imagecodecs-2023.1.23/imagecodecs/_gif.pyx.noexcept 2024-02-04 15:40:40.707246956 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_gif.pyx 2024-02-04 15:46:25.793373376 -0700
@@ -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
diff -up imagecodecs-2023.1.23/imagecodecs/_heif.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_heif.pyx
--- imagecodecs-2023.1.23/imagecodecs/_heif.pyx.noexcept 2023-01-08 01:14:08.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_heif.pyx 2024-02-04 15:49:04.754813538 -0700
@@ -769,7 +769,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 -up imagecodecs-2023.1.23/imagecodecs/_jpeg8.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_jpeg8.pyx
--- imagecodecs-2023.1.23/imagecodecs/_jpeg8.pyx.noexcept 2022-12-29 13:17:33.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_jpeg8.pyx 2024-02-04 15:51:39.046211391 -0700
@@ -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 -up imagecodecs-2023.1.23/imagecodecs/_jpegxr.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_jpegxr.pyx
--- imagecodecs-2023.1.23/imagecodecs/_jpegxr.pyx.noexcept 2023-01-08 01:16:31.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_jpegxr.pyx 2024-02-04 15:58:24.138871893 -0700
@@ -378,7 +378,7 @@ def jpegxr_decode(data, index=None, fp2i
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:
"""Replacement 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,
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:
"""Replacement 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,
return WMP_errSuccess
-cdef Bool EOSWS_Realloc(WMPStream* pWS) nogil:
+cdef Bool EOSWS_Realloc(WMPStream* pWS) noexcept nogil:
"""Replacement for EOSWS_Memory."""
# return pWS.state.buf.cbBuf <= pWS.state.buf.cbCur
return 1
diff -up imagecodecs-2023.1.23/imagecodecs/_png.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_png.pyx
--- imagecodecs-2023.1.23/imagecodecs/_png.pyx.noexcept 2022-12-29 13:17:33.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_png.pyx 2024-02-04 16:09:47.113978112 -0700
@@ -382,7 +382,7 @@ def png_decode(data, index=None, numthre
cdef void png_error_callback(
png_structp png_ptr,
png_const_charp msg
-) nogil:
+) noexcept nogil:
cdef:
mempng_t* mempng = <mempng_t*> png_get_io_ptr(png_ptr)
@@ -395,7 +395,7 @@ cdef void png_error_callback(
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())
@@ -411,7 +411,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)
@@ -436,7 +436,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)
@@ -470,7 +470,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 -up imagecodecs-2023.1.23/imagecodecs/_tiff.pyx.noexcept imagecodecs-2023.1.23/imagecodecs/_tiff.pyx
--- imagecodecs-2023.1.23/imagecodecs/_tiff.pyx.noexcept 2022-12-29 13:17:33.000000000 -0700
+++ imagecodecs-2023.1.23/imagecodecs/_tiff.pyx 2024-02-04 16:19:07.467291854 -0700
@@ -842,7 +842,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))
@@ -864,7 +864,7 @@ cdef memtif_t* memtif_new(toff_t size, t
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:
@@ -876,7 +876,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
@@ -892,7 +892,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
@@ -919,7 +919,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
@@ -968,7 +968,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
@@ -977,7 +977,7 @@ cdef int memtif_TIFFCloseProc(thandle_t
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
@@ -989,7 +989,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
@@ -1003,7 +1003,7 @@ cdef void memtif_TIFFUnmapFileProc(
thandle_t handle,
void* base,
toff_t size
-) nogil:
+) noexcept nogil:
"""Callback function to unmap memtif."""
return
@@ -1014,7 +1014,7 @@ cdef int 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
@@ -1036,7 +1036,7 @@ cdef int 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]