imghdr

Recognize image file formats based on their first few bytes.

Functions

test()
test_bmp(h, f)
test_exif(h, f) JPEG data in Exif format
test_gif(h, f) GIF (‘87 and ‘89 variants)
test_jpeg(h, f) JPEG data in JFIF format
test_pbm(h, f) PBM (portable bitmap)
test_pgm(h, f) PGM (portable graymap)
test_png(h, f)
test_ppm(h, f) PPM (portable pixmap)
test_rast(h, f) Sun raster file
test_rgb(h, f) SGI image library
test_tiff(h, f) TIFF (can be in Motorola or Intel byte order)
test_xbm(h, f) X bitmap (X10 or X11)
testall(list, recursive, toplevel)
what(file[, h])