summaryrefslogtreecommitdiffstats
path: root/Lib/imghdr.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-06-23 09:30:50 (GMT)
committerGuido van Rossum <guido@python.org>1993-06-23 09:30:50 (GMT)
commit5cfa5dfe977854a090e70cb4f4353e2e6b46789e (patch)
tree2283617688b901adf8dbf07933f2dfe1f1c6c481 /Lib/imghdr.py
parent9b3bc715980b51ffbf535bcf159ba4be03938c19 (diff)
downloadcpython-5cfa5dfe977854a090e70cb4f4353e2e6b46789e.zip
cpython-5cfa5dfe977854a090e70cb4f4353e2e6b46789e.tar.gz
cpython-5cfa5dfe977854a090e70cb4f4353e2e6b46789e.tar.bz2
* calendar.py: all libC functionality now moved to built-in time module
* imghdr.py: added jpeg recognition * torgb.py: added jpeg conversion * tzparse.py: use functions from time instead of calendar * whatsound.py: add /ufs/guido/biin/sgi to $PATH when calling 'whatsound'
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 063bfe8..62518b5 100644
--- a/Lib/imghdr.py
+++ b/Lib/imghdr.py
@@ -81,6 +81,12 @@ def test_xbm(h, f):
tests.append(test_xbm)
+def test_jpeg(h, f):
+ # JPEG data in JFIF format
+ if h[6:10] == 'JFIF':
+ return 'jpeg'
+
+tests.append(test_jpeg)
#--------------------#
# Small test program #