Tiny Code

Tiny Code


XnView proves handy

One complaint my wife had was after the data restoration I spent much of the weekend on, all of her photos ended up with yesterday's date. This causes her problems locating photos because while she can typically remember the approximate date when she took a picture, she always can't recall for certain what she named the directory. Recently she's taken to my simple approach of prefacing the directory name with a date. I use a date of the form YYYYMMDD (year, month, day) which causes the directories to sort nicely.

I remembered JPG files contained metadata fields which stored useful information like landscape or portrait orientation (for cameras which have appropriate sensors), GPS data (for cameras with a GPS installed), photo settings, and the date the photo was taken. There's even a standard for how these metadata fields are recorded called EXIF.

A bit of searching turned up some software called XnView which allows one to perform a number of date related functions including the following:

- changing the create and/or modified file time stamps based on the date from the EXIF fields (very useful in this case)
- changing the EXIF time stamps based on the current file time stamp (useful when the camera's date was not set when the photo was taken)

As you might imagine, I was very happy to discover I didn't have to cobble together a solution on my own. While I enjoy writing the odd bash or Python script, doing so unnecessarily didn't strike me as much fun.

No comments: