[Tutor] Obtaining image date of creation

Remco Gerlich remco at gerlich.nl
Wed Nov 14 15:19:58 CET 2007


Hi,

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.

However, some more Googling led me to the PyExif library (
http//pyexif.sourceforge.net/ ) and this post by someone who did the
exact thing you want to do:
http://www.leancrew.com/all-this/2007/08/photo_file_renaming_again.html

Hope this helps :-)

Remco

On Nov 14, 2007 1:04 PM, Roy Chen <roychenlei at gmail.com> wrote:
> Hello,
>
> I would like to write a simple script that would rename a bunch of
> photos according to their creation date, i.e. the date which the
> photo was taken.
>
> Is there a way to use Python to obtain that information from the
> image file, or is that information not stored in the file?
>
> Thanks,
> Roy Chen
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list