Merge pull request #5710 from radarhere/selftest

Moved _info function into docstring
This commit is contained in:
Hugo van Kemenade 2021-09-13 10:51:44 +03:00 committed by GitHub
commit dae542b25e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,17 +14,13 @@ except AttributeError:
pass
def _info(im):
im.load()
return im.format, im.mode, im.size
def testimage():
"""
PIL lets you create in-memory images with various pixel types:
>>> from PIL import Image, ImageDraw, ImageFilter, ImageMath
>>> im = Image.new("1", (128, 128)) # monochrome
>>> def _info(im): return (im.format, im.mode, im.size)
>>> _info(im)
(None, '1', (128, 128))
>>> _info(Image.new("L", (128, 128))) # grayscale (luminance)