Merge pull request #1426 from wiredfool/convert-matrix-docs

Correct convert matrix docs
This commit is contained in:
Hugo van Kemenade 2015-09-15 11:42:59 +03:00
commit 18f5e5e123
2 changed files with 7 additions and 6 deletions

View File

@ -822,7 +822,7 @@ class Image(object):
:param mode: The requested mode. See: :ref:`concept-modes`.
:param matrix: An optional conversion matrix. If given, this
should be 4- or 16-tuple containing floating point values.
should be 4- or 12-tuple containing floating point values.
:param dither: Dithering method, used when converting from
mode "RGB" to "P" or from "RGB" or "L" to "1".
Available methods are NONE or FLOYDSTEINBERG (default).

View File

@ -768,11 +768,12 @@ _convert_matrix(ImagingObject* self, PyObject* args)
float m[12];
if (!PyArg_ParseTuple(args, "s(ffff)", &mode, m+0, m+1, m+2, m+3)) {
PyErr_Clear();
if (!PyArg_ParseTuple(args, "s(ffffffffffff)", &mode,
m+0, m+1, m+2, m+3,
m+4, m+5, m+6, m+7,
m+8, m+9, m+10, m+11))
return NULL;
if (!PyArg_ParseTuple(args, "s(ffffffffffff)", &mode,
m+0, m+1, m+2, m+3,
m+4, m+5, m+6, m+7,
m+8, m+9, m+10, m+11)){
return NULL;
}
}
return PyImagingNew(ImagingConvertMatrix(self->image, mode, m));