summaryrefslogtreecommitdiffstats
path: root/Lib/imghdr.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-01-07 08:15:41 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-01-07 08:15:41 (GMT)
commit97db05de3ee09011205e32a3e7d79ad4b1544abe (patch)
treed8b1b59328490baab43ff7ba04c3caa981855dd8 /Lib/imghdr.py
parentdd3e6cb21318b3889bab4ffb07c545a3b03ad636 (diff)
downloadcpython-97db05de3ee09011205e32a3e7d79ad4b1544abe.zip
cpython-97db05de3ee09011205e32a3e7d79ad4b1544abe.tar.gz
cpython-97db05de3ee09011205e32a3e7d79ad4b1544abe.tar.bz2
SF #75103: imghdr -- identify JPEGs in EXIF format
Diffstat (limited to 'Lib/imghdr.py')
-rw-r--r--Lib/imghdr.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/imghdr.py b/Lib/imghdr.py
index dc5fb22..2fbc966 100644
--- a/Lib/imghdr.py
+++ b/Lib/imghdr.py
@@ -101,6 +101,13 @@ def test_jpeg(h, f):
tests.append(test_jpeg)
+def test_exif(h, f):
+ """JPEG data in Exif format"""
+ if h[6:10] == 'Exif':
+ return 'jpeg'
+
+tests.append(test_exif)
+
def test_bmp(h, f):
if h[:2] == 'BM':
return 'bmp'