mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Removed unused variable from selftest
This commit is contained in:
parent
4d234fb54d
commit
0907f423ca
12
selftest.py
12
selftest.py
|
@ -14,8 +14,6 @@ from PIL import features
|
|||
if "--installed" in sys.argv:
|
||||
sys.path.insert(0, sys_path_0)
|
||||
|
||||
ROOT = "."
|
||||
|
||||
try:
|
||||
Image.core.ping
|
||||
except ImportError as v:
|
||||
|
@ -50,13 +48,13 @@ def testimage():
|
|||
|
||||
Or open existing files:
|
||||
|
||||
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.gif"))
|
||||
>>> im = Image.open("Tests/images/hopper.gif")
|
||||
>>> _info(im)
|
||||
('GIF', 'P', (128, 128))
|
||||
>>> _info(Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm")))
|
||||
>>> _info(Image.open("Tests/images/hopper.ppm"))
|
||||
('PPM', 'RGB', (128, 128))
|
||||
>>> try:
|
||||
... _info(Image.open(os.path.join(ROOT, "Tests/images/hopper.jpg")))
|
||||
... _info(Image.open("Tests/images/hopper.jpg"))
|
||||
... except IOError as v:
|
||||
... print(v)
|
||||
('JPEG', 'RGB', (128, 128))
|
||||
|
@ -64,7 +62,7 @@ def testimage():
|
|||
PIL doesn't actually load the image data until it's needed,
|
||||
or you call the "load" method:
|
||||
|
||||
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm"))
|
||||
>>> im = Image.open("Tests/images/hopper.ppm")
|
||||
>>> print(im.im) # internal image attribute
|
||||
None
|
||||
>>> a = im.load()
|
||||
|
@ -74,7 +72,7 @@ def testimage():
|
|||
You can apply many different operations on images. Most
|
||||
operations return a new image:
|
||||
|
||||
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm"))
|
||||
>>> im = Image.open("Tests/images/hopper.ppm")
|
||||
>>> _info(im.convert("L"))
|
||||
(None, 'L', (128, 128))
|
||||
>>> _info(im.copy())
|
||||
|
|
Loading…
Reference in New Issue
Block a user