diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index e6ecabc1d..d6fc9ebc5 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -172,14 +172,14 @@ OPEN_INFO = { (II, 1, (1,), 1, (16,), ()): ("I;16", "I;16"), (MM, 1, (1,), 1, (16,), ()): ("I;16B", "I;16B"), - (II, 1, (2,), 1, (16,), ()): ("I;16S", "I;16S"), - (MM, 1, (2,), 1, (16,), ()): ("I;16BS", "I;16BS"), + (II, 1, (2,), 1, (16,), ()): ("I", "I;16S"), + (MM, 1, (2,), 1, (16,), ()): ("I", "I;16BS"), (II, 0, (3,), 1, (32,), ()): ("F", "F;32F"), (MM, 0, (3,), 1, (32,), ()): ("F", "F;32BF"), (II, 1, (1,), 1, (32,), ()): ("I", "I;32N"), (II, 1, (2,), 1, (32,), ()): ("I", "I;32S"), - (MM, 1, (2,), 1, (32,), ()): ("I;32BS", "I;32BS"), + (MM, 1, (2,), 1, (32,), ()): ("I", "I;32BS"), (II, 1, (3,), 1, (32,), ()): ("F", "F;32F"), (MM, 1, (3,), 1, (32,), ()): ("F", "F;32BF"), diff --git a/Tests/images/16bit.s.tif b/Tests/images/16bit.s.tif new file mode 100644 index 000000000..f36e68d61 Binary files /dev/null and b/Tests/images/16bit.s.tif differ diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 2a9132d48..115a0e765 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -198,6 +198,13 @@ class TestFileTiff(PillowTestCase): self.assertEqual(b[0], b'\x01') self.assertEqual(b[1], b'\xe0') + def test_16bit_s(self): + im = Image.open('Tests/images/16bit.s.tif') + im.load() + self.assertEqual(im.mode, 'I') + self.assertEqual(im.getpixel((0,0)),32767) + self.assertEqual(im.getpixel((0,1)),0) + def test_12bit_rawmode(self): """ Are we generating the same interpretation of the image as Imagemagick is? """