mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
commit
e3eac00b1f
|
@ -88,20 +88,13 @@ class TestFilePng(PillowTestCase):
|
|||
self.assertEqual(im.format, "PNG")
|
||||
self.assertEqual(im.get_format_mimetype(), 'image/png')
|
||||
|
||||
hopper("1").save(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("L").save(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("P").save(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("RGB").save(test_file)
|
||||
Image.open(test_file)
|
||||
|
||||
hopper("I").save(test_file)
|
||||
Image.open(test_file)
|
||||
for mode in ["1", "L", "P", "RGB", "I", "I;16"]:
|
||||
im = hopper(mode)
|
||||
im.save(test_file)
|
||||
reloaded = Image.open(test_file)
|
||||
if mode == "I;16":
|
||||
reloaded = reloaded.convert(mode)
|
||||
self.assert_image_equal(reloaded, im)
|
||||
|
||||
def test_invalid_file(self):
|
||||
invalid_file = "Tests/images/flower.jpg"
|
||||
|
|
|
@ -459,8 +459,9 @@ Pillow reads and writes PCX files containing ``1``, ``L``, ``P``, or ``RGB`` dat
|
|||
PNG
|
||||
^^^
|
||||
|
||||
Pillow identifies, reads, and writes PNG files containing ``1``, ``L``, ``P``,
|
||||
``RGB``, or ``RGBA`` data. Interlaced files are supported as of v1.1.7.
|
||||
Pillow identifies, reads, and writes PNG files containing ``1``, ``L``, ``LA``,
|
||||
``I``, ``P``, ``RGB`` or ``RGBA`` data. Interlaced files are supported as of
|
||||
v1.1.7.
|
||||
|
||||
As of Pillow 6.0, EXIF data can be read from PNG images. However, unlike other
|
||||
image formats, EXIF data is not guaranteed to have been read until
|
||||
|
|
|
@ -707,6 +707,7 @@ _OUTMODES = {
|
|||
"L": ("L", b'\x08\x00'),
|
||||
"LA": ("LA", b'\x08\x04'),
|
||||
"I": ("I;16B", b'\x10\x00'),
|
||||
"I;16": ("I;16B", b'\x10\x00'),
|
||||
"P;1": ("P;1", b'\x01\x03'),
|
||||
"P;2": ("P;2", b'\x02\x03'),
|
||||
"P;4": ("P;4", b'\x04\x03'),
|
||||
|
|
|
@ -639,6 +639,7 @@ static struct {
|
|||
|
||||
/* storage modes */
|
||||
{"I;16", "I;16", 16, copy2},
|
||||
{"I;16", "I;16B", 16, packI16N_I16B},
|
||||
{"I;16B", "I;16B", 16, copy2},
|
||||
{"I;16L", "I;16L", 16, copy2},
|
||||
{"I;16", "I;16N", 16, packI16N_I16}, // LibTiff native->image endian.
|
||||
|
|
Loading…
Reference in New Issue
Block a user