Support and test for 4-bit greyscale TIFF

This commit is contained in:
Hugo 2014-10-02 10:43:22 +03:00
parent 29b1c81a9e
commit 552a9a28a0
2 changed files with 14 additions and 2 deletions

View File

@ -149,6 +149,7 @@ OPEN_INFO = {
(II, 0, 1, 2, (8,), ()): ("L", "L;IR"),
(II, 0, 3, 1, (32,), ()): ("F", "F;32F"),
(II, 1, 1, 1, (1,), ()): ("1", "1"),
(II, 1, 1, 1, (4,), ()): ("L", "L;4"),
(II, 1, 1, 2, (1,), ()): ("1", "1;R"),
(II, 1, 1, 1, (8,), ()): ("L", "L"),
(II, 1, 1, 1, (8, 8), (2,)): ("LA", "LA"),

View File

@ -298,6 +298,17 @@ class TestFileTiff(PillowTestCase):
# Assert
self.assertEqual(ret, [0, 1])
def test_4bit(self):
# Arrange
test_file = "Tests/images/hopper_gray_4bpp.tif"
# Act
im = Image.open(test_file)
# Assert
self.assertEqual(im.size, (128, 128))
self.assertEqual(im.mode, "L")
if __name__ == '__main__':
unittest.main()