From 2d2474685a48575f4aa4b1e3c0d9b07dafd21b4e Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 29 Oct 2014 11:07:20 -0700 Subject: [PATCH] Added 4bit test to libtiff as well --- Tests/test_file_libtiff.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 85b796242..efd2d5817 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -342,6 +342,24 @@ class TestFileLibTiff(LibTiffTestCase): im.load() self.assertFalse(im.tag.next) + def test_4bit(self): + # Arrange + test_file = "Tests/images/hopper_gray_4bpp.tif" + original = hopper("L") + + # Act + TiffImagePlugin.READ_LIBTIFF = True + im = Image.open(test_file) + TiffImagePlugin.READ_LIBTIFF = False + + # Assert + self.assertEqual(im.size, (128, 128)) + self.assertEqual(im.mode, "L") + self.assert_image_similar(im, original, 7.3) + + + + if __name__ == '__main__': unittest.main()