adding apng extension for png

This commit is contained in:
pirate486743186 2018-12-18 19:33:34 +01:00
parent 9dd0348be2
commit 8d0b7e6b57
3 changed files with 13 additions and 1 deletions

BIN
Tests/images/iss634.apng Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

View File

@ -335,6 +335,18 @@ class TestFilePng(PillowTestCase):
im.load()
self.assertRaises(RuntimeError, im.verify)
def test_apng_load_verify(self):
# Check open/load/verify exception (@PIL150)
TEST_APNG_FILE = "Tests/images/iss634.apng"
im = Image.open(TEST_APNG_FILE)
# Assert that there is no unclosed file warning
self.assert_warning(None, im.verify)
im = Image.open(TEST_APNG_FILE)
im.load()
self.assertRaises(RuntimeError, im.verify)
def test_verify_struct_error(self):
# Check open/load/verify exception (#1755)

View File

@ -868,6 +868,6 @@ def getchunks(im, **params):
Image.register_open(PngImageFile.format, PngImageFile, _accept)
Image.register_save(PngImageFile.format, _save)
Image.register_extension(PngImageFile.format, ".png")
Image.register_extensions(PngImageFile.format, [".png", ".apng"])
Image.register_mime(PngImageFile.format, "image/png")