diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-06-26 16:27:57 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-06-26 16:27:57 (GMT) |
commit | 2f60820f4c1bdfce75f30ddc53d97587a3256dcf (patch) | |
tree | 6b115cf76be50645d161ebde14913202bbd64403 /Lib/imghdr.py | |
parent | a157867a3d10e4ee802fa2fd910f2dda383fa823 (diff) | |
download | cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.zip cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.tar.gz cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.tar.bz2 |
#20295: Teach imghdr to recognize OpenEXR format images.
Patch by Martin Vignali, test by Claudiu Popa.
Diffstat (limited to 'Lib/imghdr.py')
-rw-r--r-- | Lib/imghdr.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/imghdr.py b/Lib/imghdr.py index fe77e49..b267925 100644 --- a/Lib/imghdr.py +++ b/Lib/imghdr.py @@ -116,6 +116,12 @@ def test_webp(h, f): tests.append(test_webp) +def test_exr(h, f): + if h.startswith(b'\x76\x2f\x31\x01'): + return 'exr' + +tests.append(test_exr) + #--------------------# # Small test program # #--------------------# |