mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 05:06:49 +03:00
Tightened up the tests
This commit is contained in:
parent
0492409def
commit
598bd02650
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
|
@ -257,20 +257,17 @@ def test_save_icc_profile_none():
|
||||||
im = Image.open(in_file)
|
im = Image.open(in_file)
|
||||||
assert_equal(im.info['icc_profile'], None)
|
assert_equal(im.info['icc_profile'], None)
|
||||||
|
|
||||||
f = tempfile("temp.png")
|
im = roundtrip(im)
|
||||||
assert_no_exception(lambda: im.save(f))
|
|
||||||
im = Image.open(f)
|
|
||||||
assert_false('icc_profile' in im.info)
|
assert_false('icc_profile' in im.info)
|
||||||
|
|
||||||
def test_save_icc_profile_exists():
|
def test_roundtrip_icc_profile():
|
||||||
# check icc profile is kept during save()
|
# check that we can roundtrip the icc profile
|
||||||
in_file = "Tests/images/trollface.png"
|
im = lena('RGB')
|
||||||
im = Image.open(in_file)
|
|
||||||
orig_profile = im.info['icc_profile']
|
|
||||||
assert_equal(len(orig_profile), 6636)
|
|
||||||
|
|
||||||
f = tempfile("temp.png")
|
jpeg_image = Image.open('Tests/images/flower2.jpg')
|
||||||
assert_no_exception(lambda: im.save(f))
|
expected_icc = jpeg_image.info['icc_profile']
|
||||||
|
|
||||||
|
im.info['icc_profile'] = expected_icc
|
||||||
|
im = roundtrip(im)
|
||||||
|
assert_equal(im.info['icc_profile'], expected_icc)
|
||||||
|
|
||||||
im = Image.open(f)
|
|
||||||
assert_equal(im.info['icc_profile'], orig_profile)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user