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