George LeCompte wrote: > How do I recover camera information such as shtter speed, focal length > from the header of a JPG image?
Assuming a recent version of PIL, you can use the _getexif() method on JPEG images to get the raw EXIF information, and use the dictionaries in the ExifTags module to map from EXIT codes and back (alternatively, look up the keys in the EXIF specification). Example: >>> import Image, ExifTags >>> im = Image.open("im001.jpg") >>> im._getexif().keys() [36864, 37121, 37122, 36867, 36868, 37381, 37510, 37383, ... >>> for key, value in sorted(im._getexif().items()): ... print key, ExifTags.TAGS.get(key), value ... 271 Make Canon 272 Model Canon PowerShot A85 274 Orientation 1 282 XResolution (180, 1) 283 YResolution (180, 1) 296 ResolutionUnit 2 306 DateTime 2005:08:14 10:24:05 531 YCbCrPositioning 1 33434 ExposureTime (1, 160) 33437 FNumber (48, 10) 34665 ExifOffset 196 36864 ExifVersion 0220 36867 DateTimeOriginal 2005:08:14 10:24:05 36868 DateTimeDigitized 2005:08:14 10:24:05 ... </F> _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig