David Findlay

a man, a plan, a cake: nirvana

Correct dates on Flickr photos

When I drank the Flickr cool-aid, I had to move all of my pictures from my home-grown Perl/CGI webserver setup. They uploaded to Flickr just fine, but quite a few of them had incorrect dates due to incorrect or missing EXIF information. Fortunately I had all of the image files named in the YYMMDD_n.JPG format, so I knew there had to be a way to fix their dates programmatically.

Starting from the python script I had previously written to archive my photo tagging information (see this post), I just had to add a function that used a regular expression to parse the date information out of the photos' filenames and call photos.set_Data in the Flickr API. The function is up on TextMate's pastie site for those interested.