Closed Schamschula closed 2 months ago
Can you try to build with:
diff --git a/imagecodecs/libjpeg.pxd b/imagecodecs/libjpeg.pxd
index 501d468..45af300 100644
--- a/imagecodecs/libjpeg.pxd
+++ b/imagecodecs/libjpeg.pxd
@@ -47,9 +47,9 @@ cdef extern from 'jpeglib.h' nogil:
struct jpeg_error_mgr:
int msg_code
const char** jpeg_message_table
- noreturn_t error_exit(jpeg_common_struct*)
- void output_message(jpeg_common_struct*)
- void format_message(jpeg_common_struct* cinfo, char* buffer)
+ noreturn_t error_exit(jpeg_common_struct*) nogil
+ void output_message(jpeg_common_struct*) nogil
+ void format_message(jpeg_common_struct* cinfo, char* buffer) nogil
struct jpeg_common_struct:
jpeg_error_mgr* err
or, if you have libjpeg-turbo >= 3.0:
diff --git a/setup.py b/setup.py
index f0e4f7a..15fda0c 100644
--- a/setup.py
+++ b/setup.py
@@ -594,7 +594,7 @@ def customize_build_macports(EXTENSIONS, OPTIONS):
del EXTENSIONS['zlibng']
# uncomment if building with libjpeg-turbo 3
- # EXTENSIONS['jpeg8']['sources'] = []
+ EXTENSIONS['jpeg8']['sources'] = []
EXTENSIONS['szip']['library_dirs'] = ['%PREFIX%/lib/libaec/lib']
EXTENSIONS['szip']['include_dirs'] = ['%PREFIX%/lib/libaec/include']
The second patch worked for me!
See: https://github.com/macports/macports-ports/commit/728e4fbfe243c54733b8beeaa00940fb148bcf7b
The only hiccup was that the file doesn't use unix line endings, and macOS patch
didn't tell me so. However, GNU patch
did give me Hunk #1 FAILED at 594,7 (different line endings)
, and I ran unix2dos patch-setup.py.diff
and the patch applied correctly.
As MacPorts libjpeg-turbo
is at version 3.0.4, the source setup.py
should have that line uncommented.
As MacPorts libjpeg-turbo is at version 3.0.4, the source setup.py should have that line uncommented.
Excellent. The extension using libjpeg-turbo has many more features.
While attempting to update MacPorts imagecodecs to version 2024.9.22 I ran into an issue with GIL: