mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
adding apng extension for png
This commit is contained in:
parent
9dd0348be2
commit
8d0b7e6b57
BIN
Tests/images/iss634.apng
Normal file
BIN
Tests/images/iss634.apng
Normal file
Binary file not shown.
After Width: | Height: | Size: 342 KiB |
|
@ -335,6 +335,18 @@ class TestFilePng(PillowTestCase):
|
||||||
im.load()
|
im.load()
|
||||||
self.assertRaises(RuntimeError, im.verify)
|
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):
|
def test_verify_struct_error(self):
|
||||||
# Check open/load/verify exception (#1755)
|
# Check open/load/verify exception (#1755)
|
||||||
|
|
||||||
|
|
|
@ -868,6 +868,6 @@ def getchunks(im, **params):
|
||||||
Image.register_open(PngImageFile.format, PngImageFile, _accept)
|
Image.register_open(PngImageFile.format, PngImageFile, _accept)
|
||||||
Image.register_save(PngImageFile.format, _save)
|
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")
|
Image.register_mime(PngImageFile.format, "image/png")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user