2014-07-07 21:03:50 +04:00
|
|
|
from helper import unittest, PillowTestCase, lena
|
2012-10-16 00:26:38 +04:00
|
|
|
|
|
|
|
from PIL import Image
|
|
|
|
from PIL import ImageEnhance
|
|
|
|
|
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
class TestImageEnhance(PillowTestCase):
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
def test_sanity(self):
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
# FIXME: assert_image
|
|
|
|
# Implicit asserts no exception:
|
|
|
|
ImageEnhance.Color(lena()).enhance(0.5)
|
|
|
|
ImageEnhance.Contrast(lena()).enhance(0.5)
|
|
|
|
ImageEnhance.Brightness(lena()).enhance(0.5)
|
|
|
|
ImageEnhance.Sharpness(lena()).enhance(0.5)
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
def test_crash(self):
|
|
|
|
|
|
|
|
# crashes on small images
|
|
|
|
im = Image.new("RGB", (1, 1))
|
|
|
|
ImageEnhance.Sharpness(im).enhance(0.5)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
|
|
|
|
# End of file
|