mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 05:06:49 +03:00
Merge pull request #3837 from kkopachev/issue-3770
Fix bits value for RGB;16N unpackers
This commit is contained in:
commit
524c302276
BIN
Tests/images/tiff_16bit_RGB.tiff
Normal file
BIN
Tests/images/tiff_16bit_RGB.tiff
Normal file
Binary file not shown.
BIN
Tests/images/tiff_16bit_RGB_target.png
Normal file
BIN
Tests/images/tiff_16bit_RGB_target.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
|
@ -631,6 +631,21 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
# Should not raise UnicodeDecodeError or anything else
|
# Should not raise UnicodeDecodeError or anything else
|
||||||
im.save(outfile)
|
im.save(outfile)
|
||||||
|
|
||||||
|
def test_16bit_RGB_tiff(self):
|
||||||
|
im = Image.open("Tests/images/tiff_16bit_RGB.tiff")
|
||||||
|
|
||||||
|
self.assertEqual(im.mode, "RGB")
|
||||||
|
self.assertEqual(im.size, (100, 40))
|
||||||
|
self.assertEqual(
|
||||||
|
im.tile,
|
||||||
|
[('tiff_adobe_deflate', (0, 0, 100, 40), 0,
|
||||||
|
('RGB;16N', 'tiff_adobe_deflate', False))]
|
||||||
|
)
|
||||||
|
im.load()
|
||||||
|
|
||||||
|
self.assert_image_equal_tofile(
|
||||||
|
im, "Tests/images/tiff_16bit_RGB_target.png")
|
||||||
|
|
||||||
def test_16bit_RGBa_tiff(self):
|
def test_16bit_RGBa_tiff(self):
|
||||||
im = Image.open("Tests/images/tiff_16bit_RGBa.tiff")
|
im = Image.open("Tests/images/tiff_16bit_RGBa.tiff")
|
||||||
|
|
||||||
|
|
|
@ -1369,12 +1369,12 @@ static struct {
|
||||||
{"RGBA", "A", 8, band3},
|
{"RGBA", "A", 8, band3},
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
{"RGB", "RGB;16N", 64, unpackRGB16B},
|
{"RGB", "RGB;16N", 48, unpackRGB16B},
|
||||||
{"RGBA", "RGBa;16N", 64, unpackRGBa16B},
|
{"RGBA", "RGBa;16N", 64, unpackRGBa16B},
|
||||||
{"RGBA", "RGBA;16N", 64, unpackRGBA16B},
|
{"RGBA", "RGBA;16N", 64, unpackRGBA16B},
|
||||||
{"RGBX", "RGBX;16N", 64, unpackRGBA16B},
|
{"RGBX", "RGBX;16N", 64, unpackRGBA16B},
|
||||||
#else
|
#else
|
||||||
{"RGB", "RGB;16N", 64, unpackRGB16L},
|
{"RGB", "RGB;16N", 48, unpackRGB16L},
|
||||||
{"RGBA", "RGBa;16N", 64, unpackRGBa16L},
|
{"RGBA", "RGBa;16N", 64, unpackRGBa16L},
|
||||||
{"RGBA", "RGBA;16N", 64, unpackRGBA16L},
|
{"RGBA", "RGBA;16N", 64, unpackRGBA16L},
|
||||||
{"RGBX", "RGBX;16N", 64, unpackRGBA16B},
|
{"RGBX", "RGBX;16N", 64, unpackRGBA16B},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user