diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index f31ce36dc..140074cb0 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -1244,15 +1244,7 @@ class TiffImageFile(ImageFile.ImageFile): offsets = self.tag_v2[STRIPOFFSETS] h = self.tag_v2.get(ROWSPERSTRIP, ysize) w = self.size[0] - if READ_LIBTIFF or self._compression in ["tiff_ccitt", "group3", - "group4", "tiff_jpeg", - "tiff_adobe_deflate", - "tiff_thunderscan", - "tiff_deflate", - "tiff_sgilog", - "tiff_sgilog24", - "tiff_raw_16", - "jpeg"]: + if READ_LIBTIFF or self._compression != 'raw': # if DEBUG: # print("Activating g4 compression for whole file") diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index a108a922c..4092c1e7c 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -58,7 +58,7 @@ class TestFileTiff(PillowTestCase): self.assertEqual(im.mode, "RGBA") self.assertEqual(im.size, (100, 40)) - self.assertEqual(im.tile, [('tiff_lzw', (0, 0, 100, 40), 50, 'RGBa;16B')]) + self.assertEqual(im.tile, [('tiff_lzw', (0, 0, 100, 40), 0, ('RGBa;16B', 'tiff_lzw', False))]) im.load() self.assert_image_equal_tofile(im, "Tests/images/tiff_16bit_RGBa_target.png")