[Tutor] Obtaining image date of creation

Evert Rol evert.rol at gmail.com
Wed Nov 14 15:47:07 CET 2007

> I'm assuming you don't want the last changed date you see on the file
> on your PC, but the creation date that the camera stored when the
> picture was taken.
> Now I don't know much about that, but I thought it was interesting, so
> I did some Googling :-)
> I don't know whether it's always stored, but many cameras do. There
> are several formats. One of them is EXIF, no idea how universal that
> is, but it seems to be pretty wide spread.
> Unfortunately, the most common Python library for image stuff (PIL)
> doesn't handle this.

I think EXIF does what the OP wants; you may loose the exif  
information if you do too much editing on your image, but otherwise  
it'll be on RAW images and JPEG images. I'm not sure if PIL handles  
RAW images, so you may need to use JPEGs (perhaps you're already  
doing that).

And while I haven't tried it, this page (http://effbot.org/zone/pil- 
changes-114.htm) appears to indicate exif format is somewhat  
supported in PIL; perhaps pyexif does a better job though?

More information about the Tutor mailing list