type check

This commit is contained in:
homm 2014-10-12 22:39:02 +04:00
parent 2c723abbca
commit 835db5d12f

View File

@ -139,6 +139,16 @@ HorizontalBoxBlur8(Imaging im, Imaging imOut, float floatRadius)
Imaging
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). */
Imaging temp = ImagingNew(im->mode, im->ysize, im->xsize);
if ( ! temp)