From 423e381b7cec539118b9a27c787477db31759cf9 Mon Sep 17 00:00:00 2001 From: John Calsbeek Date: Wed, 25 Nov 2015 20:34:44 -0800 Subject: [PATCH 1/2] ExtraSamples tag should be a SHORT, not a BYTE Affects saving RGBA TIFFs. --- PIL/TiffTags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/TiffTags.py b/PIL/TiffTags.py index 5af739742..2eb06d315 100644 --- a/PIL/TiffTags.py +++ b/PIL/TiffTags.py @@ -106,7 +106,7 @@ TAGS_V2 = { 334: ("NumberOfInks", 3, 1), 336: ("DotRange", 3, 0), 337: ("TargetPrinter", 2, 1), - 338: ("ExtraSamples", 1, 0), + 338: ("ExtraSamples", 3, 0), 339: ("SampleFormat", 3, 0), 340: ("SMinSampleValue", 12, 0), From b496f37e1f09c452b4db2bb52cd3eb9d8ca36801 Mon Sep 17 00:00:00 2001 From: John Calsbeek Date: Tue, 1 Dec 2015 09:14:32 -0800 Subject: [PATCH 2/2] Add test for #1524. --- Tests/test_file_tiff.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 719888619..926aa5602 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -115,6 +115,11 @@ class TestFileTiff(PillowTestCase): self.fail( "Bad EXIF data passed incorrect values to _binary unpack") + def test_save_rgba(self): + im = hopper("RGBA") + outfile = self.tempfile("temp.tif") + im.save(outfile) + def test_save_unsupported_mode(self): im = hopper("HSV") outfile = self.tempfile("temp.tif")