From a18ef74886cd20233076e4a5b47de63ec4ce2e64 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sun, 20 Oct 2013 20:54:12 -0700 Subject: [PATCH] pass bool flag as int, not object --- _webp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_webp.c b/_webp.c index 5c733655a..2dab29fde 100644 --- a/_webp.c +++ b/_webp.c @@ -25,7 +25,7 @@ PyObject* WebPEncode_wrapper(PyObject* self, PyObject* args) Py_ssize_t exif_size; size_t ret_size; - if (!PyArg_ParseTuple(args, "s#iiOfss#s#", + if (!PyArg_ParseTuple(args, "s#iiifss#s#", (char**)&rgb, &size, &width, &height, &lossless, &quality_factor, &mode, &icc_bytes, &icc_size, &exif_bytes, &exif_size)) { Py_RETURN_NONE; @@ -34,7 +34,7 @@ PyObject* WebPEncode_wrapper(PyObject* self, PyObject* args) if (size < width * height * 4){ Py_RETURN_NONE; } - if (PyObject_IsTrue(lossless)) { + if (lossless) { ret_size = WebPEncodeLosslessRGBA(rgb, width, height, 4* width, &output); } else { ret_size = WebPEncodeRGBA(rgb, width, height, 4* width, quality_factor, &output); @@ -43,7 +43,7 @@ PyObject* WebPEncode_wrapper(PyObject* self, PyObject* args) if (size < width * height * 3){ Py_RETURN_NONE; } - if (PyObject_IsTrue(lossless)) { + if (lossless) { ret_size = WebPEncodeLosslessRGB(rgb, width, height, 3* width, &output); } else { ret_size = WebPEncodeRGB(rgb, width, height, 3* width, quality_factor, &output);