diff options
author | Raymond Hettinger <python@rcn.com> | 2005-01-07 08:15:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-01-07 08:15:41 (GMT) |
commit | 97db05de3ee09011205e32a3e7d79ad4b1544abe (patch) | |
tree | d8b1b59328490baab43ff7ba04c3caa981855dd8 /Lib/imghdr.py | |
parent | dd3e6cb21318b3889bab4ffb07c545a3b03ad636 (diff) | |
download | cpython-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.py | 7 |
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' |