mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
ImageOps.box_blur is deprecated, use ImageFilter.BoxBlur instead
This commit is contained in:
parent
f733482c0e
commit
7e8998a452
|
@ -1,6 +1,6 @@
|
||||||
from helper import unittest, PillowTestCase
|
from helper import unittest, PillowTestCase
|
||||||
|
|
||||||
from PIL import Image, ImageOps
|
from PIL import Image, ImageFilter
|
||||||
|
|
||||||
|
|
||||||
sample = Image.new("L", (7, 5))
|
sample = Image.new("L", (7, 5))
|
||||||
|
@ -16,7 +16,7 @@ sample.putdata(sum([
|
||||||
class TestBoxBlurApi(PillowTestCase):
|
class TestBoxBlurApi(PillowTestCase):
|
||||||
|
|
||||||
def test_imageops_box_blur(self):
|
def test_imageops_box_blur(self):
|
||||||
i = ImageOps.box_blur(sample, 1)
|
i = sample.filter(ImageFilter.BoxBlur(1))
|
||||||
self.assertEqual(i.mode, sample.mode)
|
self.assertEqual(i.mode, sample.mode)
|
||||||
self.assertEqual(i.size, sample.size)
|
self.assertEqual(i.size, sample.size)
|
||||||
self.assertIsInstance(i, Image.Image)
|
self.assertIsInstance(i, Image.Image)
|
||||||
|
|
|
@ -17,6 +17,11 @@ class TestImageOpsUsm(PillowTestCase):
|
||||||
self.assertEqual(i.mode, "RGB")
|
self.assertEqual(i.mode, "RGB")
|
||||||
self.assertEqual(i.size, (128, 128))
|
self.assertEqual(i.size, (128, 128))
|
||||||
|
|
||||||
|
i = self.assert_warning(DeprecationWarning,
|
||||||
|
ImageOps.box_blur, im, 1)
|
||||||
|
self.assertEqual(i.mode, "RGB")
|
||||||
|
self.assertEqual(i.size, (128, 128))
|
||||||
|
|
||||||
i = self.assert_warning(DeprecationWarning,
|
i = self.assert_warning(DeprecationWarning,
|
||||||
ImageOps.gblur, im, 2.0)
|
ImageOps.gblur, im, 2.0)
|
||||||
self.assertEqual(i.mode, "RGB")
|
self.assertEqual(i.mode, "RGB")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user