=====================================
It's been bothering me for a few years now -- my girlfriend's camera has an incorrect date/time setting. As a result, any photos that I import from her camera get sorted incorrectly by date by programs like Picasa or Windows Explorer (view -> details shows "Date Picture Taken").
The date and time data are not stored concurrently with the file access/create/modify data, but are instead stored inside the JPEG file, in the metadata portion. This portion is known as EXIF data, and provides a space for your camera to record all sorts of good information about the photo, such as resolution, shutter speed, F-stop, flash settings, and more. However, this data proves to be a formidable data structure to tackle independently. Luckily for me, I found a lovely library known as Exiv2. Exiv2 provides a cross-platform library for reading and writing the EXIF and metadata inside JPEG files. Using the library, it is possible to add, modify, or remove this metadata.
Some very useful scenarios for this include
- setting the date of a scanned photo
- correcting the date of photos from a digital camera that was not configured properly
- storing other, extra information about a photo inside the photo itself.
I'll be posting my source code to SourceForge as soon as the project is approved. Check back for more info.
[UPDATE]: After I spent time successfully writing software to perform this action, it appears as if my efforts are futile. Every time I turn on the Pentax Optio S40, the time changes by 1 hour and 20 minutes. By turning on and off the camera repeatedly, I find this to be fairly consistent.
I turned the camera on/off within seconds, and noticed the time change:
- 7/3/2008 10:02pm
- 7/3/2008 8:42pm
- 7/3/2008 7:22pm
- 7/3/2008 6:02pm
I still plan on posting the source code to my application on SourceForge, pending approval.