mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
Merge pull request #2748 from wiredfool/i16s
Fix TIFF support for I;16S, I;16BS, and I;32BS rawmodes
This commit is contained in:
commit
6198422383
|
@ -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"),
|
||||
|
||||
|
|
BIN
Tests/images/16bit.s.tif
Normal file
BIN
Tests/images/16bit.s.tif
Normal file
Binary file not shown.
|
@ -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? """
|
||||
|
|
Loading…
Reference in New Issue
Block a user