From 388c25b7818063829a27c11ab9d396b3b78af3ee Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 23 Oct 2013 20:50:01 -0700 Subject: [PATCH] PhotometricInterpretation is set from SAVE_INFO, not the original image, so spurious test failure. --- Tests/test_file_libtiff.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index cb81282c2..51ee79ab7 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -111,6 +111,7 @@ def test_write_metadata(): """ Test metadata writing through libtiff """ img = Image.open('Tests/images/lena_g4.tif') f = tempfile('temp.tiff') + img.save(f, tiffinfo = img.tag) loaded = Image.open(f) @@ -118,8 +119,9 @@ def test_write_metadata(): original = img.tag.named() reloaded = loaded.tag.named() - ignored = ['StripByteCounts', 'RowsPerStrip', 'PageNumber'] - + # PhotometricInterpretation is set from SAVE_INFO, not the original image. + ignored = ['StripByteCounts', 'RowsPerStrip', 'PageNumber', 'PhotometricInterpretation'] + for tag, value in reloaded.items(): if tag not in ignored: assert_equal(original[tag], value, "%s didn't roundtrip" % tag)