mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-15 01:34:45 +03:00
parse tuple into "r" and "g" instead of "r" and "a" because we want to put the values in the first two bytes
This commit is contained in:
parent
e5039f8c15
commit
a63bcfbfb4
|
@ -550,10 +550,9 @@ getink(PyObject *color, Imaging im, char *ink) {
|
||||||
if (tupleSize != 1 && tupleSize != 2) {
|
if (tupleSize != 1 && tupleSize != 2) {
|
||||||
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one or two elements");
|
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one or two elements");
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (!PyArg_ParseTuple(color, "L|i", &r, &a)) {
|
} else if (!PyArg_ParseTuple(color, "L|i", &r, &g)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
g = b = r;
|
|
||||||
} else {
|
} else {
|
||||||
if (tupleSize != 3 && tupleSize != 4) {
|
if (tupleSize != 3 && tupleSize != 4) {
|
||||||
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one, three or four elements");
|
PyErr_SetString(PyExc_TypeError, "color must be int, or tuple of one, three or four elements");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user