From f94518bb35aa9154652b08c734bc75748c198a7e Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Thu, 27 Jun 2019 23:55:01 -0700 Subject: [PATCH] Add TIFFTAG_SAMPLEFORMAT to blocklist The SAMPLEFORMAT tag is determined by the image format and should not be copied from legacy_ifd. --- src/PIL/TiffImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 7596aae65..094d1be37 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1540,7 +1540,7 @@ def _save(im, fp, filename): # STRIPOFFSETS and STRIPBYTECOUNTS are added by the library # based on the data in the strip. - blocklist = [STRIPOFFSETS, STRIPBYTECOUNTS] + blocklist = [STRIPOFFSETS, STRIPBYTECOUNTS, SAMPLEFORMAT] atts = {} # bits per sample is a single short in the tiff directory, not a list. atts[BITSPERSAMPLE] = bits[0]