Skip to content

Commit 8b8d2a6

Browse files
committed
Pass size as tuple to C, as per python-pillow#8733
1 parent 3d22733 commit 8b8d2a6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/PIL/AvifImagePlugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ def _save(
212212

213213
# Setup the AVIF encoder
214214
enc = _avif.AvifEncoder(
215-
im.size[0],
216-
im.size[1],
215+
im.size,
217216
subsampling,
218217
quality,
219218
speed,
@@ -260,8 +259,7 @@ def _save(
260259
enc.add(
261260
frame.tobytes("raw", rawmode),
262261
frame_dur,
263-
frame.size[0],
264-
frame.size[1],
262+
frame.size,
265263
rawmode,
266264
is_single_frame,
267265
)

src/_avif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ AvifEncoderNew(PyObject *self_, PyObject *args) {
252252

253253
if (!PyArg_ParseTuple(
254254
args,
255-
"IIsiiissiiOOy*y*iy*O",
255+
"(II)siiissiiOOy*y*iy*O",
256256
&width,
257257
&height,
258258
&subsampling,
@@ -479,7 +479,7 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
479479

480480
if (!PyArg_ParseTuple(
481481
args,
482-
"z#IIIsO",
482+
"z#I(II)sO",
483483
(char **)&rgb_bytes,
484484
&size,
485485
&duration,

0 commit comments

Comments
 (0)