From a70da8112dc10713072e11552b3b7bbdcdb34d3d 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 835c460a5..cf91211b2 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]