commit | 2f8dca735e9e30aab6cea2270875021b3098bd2a | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Sun May 25 11:45:37 2014 +0300 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Sun May 25 11:45:37 2014 +0300 |
tree | 74cf9e463b935a6d961cf5d7948d293221fb4454 | |
parent | e84d26c61b826792f62d49cda64f1f8c76dcf55c [diff] [blame] |
Issue #20197: Added support for the WebP image type in the imghdr module. Patch by Fabrice Aneche and Claudiu Popa.
diff --git a/Lib/imghdr.py b/Lib/imghdr.py index add2ea8..fe77e49 100644 --- a/Lib/imghdr.py +++ b/Lib/imghdr.py
@@ -110,6 +110,12 @@ tests.append(test_bmp) +def test_webp(h, f): + if h.startswith(b'RIFF') and h[8:12] == b'WEBP': + return 'webp' + +tests.append(test_webp) + #--------------------# # Small test program # #--------------------#