Skip to content

Commit

Permalink
Use boolean format argument for irreversible
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 8, 2025
1 parent b57b4e5 commit 166d0b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {
PyObject *quality_layers = NULL;
Py_ssize_t num_resolutions = 0;
PyObject *cblk_size = NULL, *precinct_size = NULL;
PyObject *irreversible = NULL;
int irreversible = 0;
char *progression = "LRCP";
OPJ_PROG_ORDER prog_order;
char *cinema_mode = "no";
Expand All @@ -1267,7 +1267,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {

if (!PyArg_ParseTuple(
args,
"ss|OOOsOnOOOssbbnz#p",
"ss|OOOsOnOOpssbbnz#p",
&mode,
&format,
&offset,
Expand Down Expand Up @@ -1402,7 +1402,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {
precinct_size, &context->precinct_width, &context->precinct_height
);

context->irreversible = PyObject_IsTrue(irreversible);
context->irreversible = irreversible;
context->progression = prog_order;
context->cinema_mode = cine_mode;
context->mct = mct;
Expand Down

0 comments on commit 166d0b9

Please sign in to comment.