mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
accept RGBa and La modes for blur
This commit is contained in:
parent
15586c5b59
commit
edc9880b61
|
@ -64,10 +64,12 @@ class TestBoxBlur(PillowTestCase):
|
|||
self.assertRaises(ValueError, self.box_blur, sample.convert("P"))
|
||||
self.box_blur(sample.convert("L"))
|
||||
self.box_blur(sample.convert("LA"))
|
||||
self.box_blur(sample.convert("LA").convert("La"))
|
||||
self.assertRaises(ValueError, self.box_blur, sample.convert("I"))
|
||||
self.assertRaises(ValueError, self.box_blur, sample.convert("F"))
|
||||
self.box_blur(sample.convert("RGB"))
|
||||
self.box_blur(sample.convert("RGBA"))
|
||||
self.box_blur(sample.convert("RGBA").convert("RGBa"))
|
||||
self.box_blur(sample.convert("CMYK"))
|
||||
self.assertRaises(ValueError, self.box_blur, sample.convert("YCbCr"))
|
||||
|
||||
|
|
|
@ -257,10 +257,12 @@ ImagingBoxBlur(Imaging imOut, Imaging imIn, float radius, int n)
|
|||
|
||||
if (!(strcmp(imIn->mode, "RGB") == 0 ||
|
||||
strcmp(imIn->mode, "RGBA") == 0 ||
|
||||
strcmp(imIn->mode, "RGBa") == 0 ||
|
||||
strcmp(imIn->mode, "RGBX") == 0 ||
|
||||
strcmp(imIn->mode, "CMYK") == 0 ||
|
||||
strcmp(imIn->mode, "L") == 0 ||
|
||||
strcmp(imIn->mode, "LA") == 0))
|
||||
strcmp(imIn->mode, "LA") == 0 ||
|
||||
strcmp(imIn->mode, "La") == 0))
|
||||
return ImagingError_ModeError();
|
||||
|
||||
imTransposed = ImagingNew(imIn->mode, imIn->ysize, imIn->xsize);
|
||||
|
|
Loading…
Reference in New Issue
Block a user