1530 static PyObject*
1531 im_setmode(ImagingObject* self, PyObject* args)
1532 {
1533 /* attempt to modify the mode of an image in place */
1534
1535 Imaging im;
1536
1537 char* mode;
1538 int modelen;
1539 if (!PyArg_ParseTuple(args, "s#:setmode", &mode, &modelen))
when PyArg_ParseTuple() succeeds
taking False path
1540 return NULL;
1541
1542 im = self->image;
1543
1544 /* move all logic in here to the libImaging primitive */
1545
1546 if (!strcmp(im->mode, mode)) {
when treating unknown struct ImagingMemoryInstance * from _imaging.c:1542 as non-NULL
when considering range: -0x80000000 <= value <= -1
taking False path
1547 ; /* same mode; always succeeds */
1548 } else if (IS_RGB(im->mode) && IS_RGB(mode)) {
taking True path
when considering range: -0x80000000 <= value <= -1
taking False path
taking False path
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
taking False path
when considering value == (int)0 from _imaging.c:1548
taking True path
taking True path
when treating unknown const char * from _imaging.c:1539 as non-NULL
when considering range: -255 <= value <= -1
taking False path
taking False path
taking False path
when considering range: 1 <= value <= 0x7fffffff
taking False path
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
1549 /* color to color */
1550 strcpy(im->mode, mode);
1551 im->bands = modelen;
1552 if (!strcmp(mode, "RGBA"))
1553 (void) ImagingFillBand(im, 3, 255);
1554 } else {
1555 /* trying doing an in-place conversion */
1556 if (!ImagingConvertInPlace(im, mode))
when treating unknown struct ImagingMemoryInstance * from _imaging.c:1556 as NULL
taking True path
1557 return NULL;
1558 }
1559
1560 if (self->access)
1561 ImagingAccessDelete(im, self->access);
1562 self->access = ImagingAccessNew(im);
1563
1564 Py_INCREF(Py_None);
1565 return Py_None;
1566 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this