summaryrefslogtreecommitdiffstats
path: root/Lib/imghdr.py
Commit message (Collapse)AuthorAgeFilesLines
* Improved patches for sndhdr and imghdr by Victor Stinner, who writes:Guido van Rossum2007-08-131-18/+10
| | | | | | | | - fix "h[sbseek] == b'\1'" and "ratecode = ord(h[sbseek+4])" in test_voc() - avoid division by zero - use startswith method: replace h[:2] == b'BM' by h.startswith(b'BM') - use aifc.open() instead of old aifc.openfp() - use ord(b'P') instead of ord('P')
* Compare what's read from files against proper byte literals. Neither of theseBarry Warsaw2007-08-121-12/+15
| | | | | | | | | | | | | modules have unittests AFAICT, and I'm not improving things here, but these changes make a bunch of email package tests succeed, and command line testing against real files seems to make things better. Added an __main__ section to imghdr.py so that it can be run from the command line similarly to sndhdr.py. Someone else can figure out a better -m way of doing this. In sndhdr.py do a couple of very minor cleanups, and use a with statement to not wait for gc to close the file.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-6/+6
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* SF #75103: imghdr -- identify JPEGs in EXIF formatRaymond Hettinger2005-01-071-0/+7
|
* a few more modules get __all__Skip Montanaro2001-01-241-0/+1
|
* Whitespace normalization.Tim Peters2001-01-141-2/+2
|
* More trivial comment -> docstring transformations by Ka-Ping Yee,Guido van Rossum2000-02-041-88/+88
| | | | | | | | | | | | | | | | | | who writes: Here is batch 2, as a big collection of CVS context diffs. Along with moving comments into docstrings, i've added a couple of missing docstrings and attempted to make sure more module docstrings begin with a one-line summary. I did not add docstrings to the methods in profile.py for fear of upsetting any careful optimizations there, though i did move class documentation into class docstrings. The convention i'm using is to leave credits/version/copyright type of stuff in # comments, and move the rest of the descriptive stuff about module usage into module docstrings. Hope this is okay.
* Allow open file as parameter (must be seekable) (Jack)Guido van Rossum1997-10-081-4/+10
|
* (Jack:) Recognize PNG files.Guido van Rossum1997-04-111-0/+12
|
* imghdr.what(): check for not h'. This letsGuido van Rossum1996-08-221-1/+1
| | | | | | you do: imghdr.what(None, '') And still go down the
* Added optional second arg to what(), giving the data read from the fileGuido van Rossum1996-07-301-7/+13
| | | | (then f may be None).
* * calendar.py: all libC functionality now moved to built-in time moduleGuido van Rossum1993-06-231-0/+6
| | | | | | | * 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'
* Misc changes and new modules. whrandom is "objectified". SOCKET.pyGuido van Rossum1992-10-181-5/+21
| | | | is moved to the sgi subdirectory.
* Fix pnm test for short files and add X bitmap as recognized typeGuido van Rossum1992-06-031-1/+10
|
* Initial revisionGuido van Rossum1992-05-271-0/+98