mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
bmp test reorganization
This commit is contained in:
parent
e1489d7c76
commit
15d6cc9f57
|
@ -2,26 +2,24 @@ from tester import *
|
|||
|
||||
from PIL import Image
|
||||
|
||||
def roundtrip(im):
|
||||
outfile = tempfile("temp.bmp")
|
||||
|
||||
im.save(outfile, 'BMP')
|
||||
|
||||
reloaded = Image.open(outfile)
|
||||
reloaded.load()
|
||||
assert_equal(im.mode, reloaded.mode)
|
||||
assert_equal(im.size, reloaded.size)
|
||||
assert_equal(reloaded.format, "BMP")
|
||||
|
||||
|
||||
def test_sanity():
|
||||
roundtrip(lena())
|
||||
|
||||
file = tempfile("temp.bmp")
|
||||
roundtrip(lena("1"))
|
||||
roundtrip(lena("L"))
|
||||
roundtrip(lena("P"))
|
||||
roundtrip(lena("RGB"))
|
||||
|
||||
lena().save(file)
|
||||
|
||||
im = Image.open(file)
|
||||
im.load()
|
||||
assert_equal(im.mode, "RGB")
|
||||
assert_equal(im.size, (128, 128))
|
||||
assert_equal(im.format, "BMP")
|
||||
|
||||
lena("1").save(file)
|
||||
im = Image.open(file)
|
||||
|
||||
lena("L").save(file)
|
||||
im = Image.open(file)
|
||||
|
||||
lena("P").save(file)
|
||||
im = Image.open(file)
|
||||
|
||||
lena("RGB").save(file)
|
||||
im = Image.open(file)
|
||||
|
|
Loading…
Reference in New Issue
Block a user