diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-06-26 12:27:57 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-06-26 12:27:57 -0400 |
commit | 2f60820f4c1bdfce75f30ddc53d97587a3256dcf (patch) | |
tree | 6b115cf76be50645d161ebde14913202bbd64403 /Lib/imghdr.py | |
parent | merge (diff) | |
download | cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.tar.gz cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.tar.bz2 cpython-2f60820f4c1bdfce75f30ddc53d97587a3256dcf.zip |
#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 fe77e495fb6..b26792539d5 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 # #--------------------# |