mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-29 17:33:08 +03:00
type check
This commit is contained in:
parent
2c723abbca
commit
835db5d12f
|
@ -139,6 +139,16 @@ HorizontalBoxBlur8(Imaging im, Imaging imOut, float floatRadius)
|
||||||
Imaging
|
Imaging
|
||||||
ImagingBoxBlur(Imaging im, Imaging imOut, float radius)
|
ImagingBoxBlur(Imaging im, Imaging imOut, float radius)
|
||||||
{
|
{
|
||||||
|
if (strcmp(im->mode, imOut->mode) ||
|
||||||
|
im->type != imOut->type ||
|
||||||
|
im->bands != imOut->bands ||
|
||||||
|
im->xsize != imOut->xsize ||
|
||||||
|
im->ysize != imOut->ysize)
|
||||||
|
return ImagingError_Mismatch();
|
||||||
|
|
||||||
|
if (im->type != IMAGING_TYPE_UINT8)
|
||||||
|
return ImagingError_ModeError();
|
||||||
|
|
||||||
/* Create transposed temp image (im->ysize x im->xsize). */
|
/* Create transposed temp image (im->ysize x im->xsize). */
|
||||||
Imaging temp = ImagingNew(im->mode, im->ysize, im->xsize);
|
Imaging temp = ImagingNew(im->mode, im->ysize, im->xsize);
|
||||||
if ( ! temp)
|
if ( ! temp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user