mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Merge pull request #1914 from uploadcare/box-blur-alpha
Box blur with premultiplied alpha
This commit is contained in:
commit
6fe8d0f15b
|
@ -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