use ImagingNewDirty

This commit is contained in:
Alexander 2017-08-17 02:56:10 +03:00
parent e7cdb3718c
commit a941747f14

View File

@ -53,9 +53,8 @@ ImagingExpand(Imaging imIn, int xmargin, int ymargin, int mode)
if (xmargin < 0 && ymargin < 0) if (xmargin < 0 && ymargin < 0)
return (Imaging) ImagingError_ValueError("bad kernel size"); return (Imaging) ImagingError_ValueError("bad kernel size");
imOut = ImagingNew( imOut = ImagingNewDirty(
imIn->mode, imIn->xsize+2*xmargin, imIn->ysize+2*ymargin imIn->mode, imIn->xsize+2*xmargin, imIn->ysize+2*ymargin);
);
if (!imOut) if (!imOut)
return NULL; return NULL;
@ -352,7 +351,7 @@ ImagingFilter(Imaging im, int xsize, int ysize, const FLOAT32* kernel,
if ((xsize != 3 && xsize != 5) || xsize != ysize) if ((xsize != 3 && xsize != 5) || xsize != ysize)
return (Imaging) ImagingError_ValueError("bad kernel size"); return (Imaging) ImagingError_ValueError("bad kernel size");
imOut = ImagingNew(im->mode, im->xsize, im->ysize); imOut = ImagingNewDirty(im->mode, im->xsize, im->ysize);
if (!imOut) if (!imOut)
return NULL; return NULL;