Skip to content

Commit 166d0b9

Browse files
committed
Use boolean format argument for irreversible
1 parent b57b4e5 commit 166d0b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/encode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {
12531253
PyObject *quality_layers = NULL;
12541254
Py_ssize_t num_resolutions = 0;
12551255
PyObject *cblk_size = NULL, *precinct_size = NULL;
1256-
PyObject *irreversible = NULL;
1256+
int irreversible = 0;
12571257
char *progression = "LRCP";
12581258
OPJ_PROG_ORDER prog_order;
12591259
char *cinema_mode = "no";
@@ -1267,7 +1267,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {
12671267

12681268
if (!PyArg_ParseTuple(
12691269
args,
1270-
"ss|OOOsOnOOOssbbnz#p",
1270+
"ss|OOOsOnOOpssbbnz#p",
12711271
&mode,
12721272
&format,
12731273
&offset,
@@ -1402,7 +1402,7 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args) {
14021402
precinct_size, &context->precinct_width, &context->precinct_height
14031403
);
14041404

1405-
context->irreversible = PyObject_IsTrue(irreversible);
1405+
context->irreversible = irreversible;
14061406
context->progression = prog_order;
14071407
context->cinema_mode = cine_mode;
14081408
context->mct = mct;

0 commit comments

Comments
 (0)