summaryrefslogtreecommitdiffstats
path: root/Lib/imghdr.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-06-26 16:27:57 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-06-26 16:27:57 (GMT)
commit2f60820f4c1bdfce75f30ddc53d97587a3256dcf (patch)
tree6b115cf76be50645d161ebde14913202bbd64403 /Lib/imghdr.py
parenta157867a3d10e4ee802fa2fd910f2dda383fa823 (diff)
downloadcpython-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.py6
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 #
#--------------------#