|
1 | 1 | #define PY_SSIZE_T_CLEAN |
2 | 2 | #include <Python.h> |
3 | | -#include <stdbool.h> |
4 | 3 | #include "libImaging/Imaging.h" |
5 | 4 |
|
6 | 5 | #include <jxl/codestream_header.h> |
@@ -295,8 +294,8 @@ _jxl_decoder_new(PyObject *self, PyObject *args) { |
295 | 294 | decp->status = JxlDecoderGetBoxType(decp->decoder, btype, JXL_TRUE); |
296 | 295 | _JXL_CHECK("JxlDecoderGetBoxType"); |
297 | 296 |
|
298 | | - bool is_box_exif = !memcmp(btype, "Exif", 4); |
299 | | - bool is_box_xmp = !memcmp(btype, "xml ", 4); |
| 297 | + int is_box_exif = !memcmp(btype, "Exif", 4); |
| 298 | + int is_box_xmp = !memcmp(btype, "xml ", 4); |
300 | 299 | if (!is_box_exif && !is_box_xmp) { |
301 | 300 | // not exif/xmp box so continue |
302 | 301 | continue; |
@@ -472,6 +471,7 @@ _jxl_decoder_get_next(PyObject *self) { |
472 | 471 | decp->status |
473 | 472 | ); |
474 | 473 | PyErr_SetString(PyExc_OSError, err_msg); |
| 474 | + return NULL; |
475 | 475 | } |
476 | 476 |
|
477 | 477 | PyObject * |
@@ -562,7 +562,6 @@ setup_module(PyObject *m) { |
562 | 562 | return -1; |
563 | 563 | } |
564 | 564 |
|
565 | | - // TODO(oloke) ready object types? |
566 | 565 | PyObject *d = PyModule_GetDict(m); |
567 | 566 | PyObject *v = PyUnicode_FromString(JpegXlDecoderVersion_str()); |
568 | 567 | PyDict_SetItemString(d, "libjxl_version", v ? v : Py_None); |
|
0 commit comments