summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/imghdr.py6
-rw-r--r--Lib/test/imghdrdata/python.exrbin0 -> 2635 bytes
-rw-r--r--Lib/test/test_imghdr.py1
3 files changed, 7 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 #
#--------------------#
diff --git a/Lib/test/imghdrdata/python.exr b/Lib/test/imghdrdata/python.exr
new file mode 100644
index 0000000..773c81e
--- /dev/null
+++ b/Lib/test/imghdrdata/python.exr
Binary files differ
diff --git a/Lib/test/test_imghdr.py b/Lib/test/test_imghdr.py
index e2a1aca..b54daf8 100644
--- a/Lib/test/test_imghdr.py
+++ b/Lib/test/test_imghdr.py
@@ -18,6 +18,7 @@ TEST_FILES = (
('python.tiff', 'tiff'),
('python.xbm', 'xbm'),
('python.webp', 'webp'),
+ ('python.exr', 'exr'),
)
class UnseekableIO(io.FileIO):