File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ from :func:`what`:
4848+------------+-----------------------------------+
4949| ``'png' `` | Portable Network Graphics |
5050+------------+-----------------------------------+
51+ | ``'webp' `` | WebP files |
52+ +------------+-----------------------------------+
53+
54+ .. versionchanged :: 3.5
55+ The *webp * type was added.
5156
5257You can extend the list of file types :mod: `imghdr ` can recognize by appending
5358to this variable:
Original file line number Diff line number Diff line change @@ -110,6 +110,12 @@ def test_bmp(h, f):
110110
111111tests .append (test_bmp )
112112
113+ def test_webp (h , f ):
114+ if h .startswith (b'RIFF' ) and h [8 :12 ] == b'WEBP' :
115+ return 'webp'
116+
117+ tests .append (test_webp )
118+
113119#--------------------#
114120# Small test program #
115121#--------------------#
Original file line number Diff line number Diff line change 1616 ('python.ras' , 'rast' ),
1717 ('python.sgi' , 'rgb' ),
1818 ('python.tiff' , 'tiff' ),
19- ('python.xbm' , 'xbm' )
19+ ('python.xbm' , 'xbm' ),
20+ ('python.webp' , 'webp' ),
2021)
2122
2223class UnseekableIO (io .FileIO ):
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Pehr Anderson
4242Erik Andersén
4343Oliver Andrich
4444Ross Andrus
45+ Fabrice Aneche
4546Juancarlo Añez
4647Chris Angelico
4748Jérémy Anger
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ Core and Builtins
8989Library
9090-------
9191
92+ - Issue #20197: Added support for the WebP image type in the imghdr module.
93+ Patch by Fabrice Aneche and Claudiu Popa.
94+
9295- Issue #21513: Speedup some properties of IP addresses (IPv4Address,
9396 IPv6Address) such as .is_private or .is_multicast.
9497
You can’t perform that action at this time.
0 commit comments