As we’ve already established, I love to take photos, and I have a strong bias toward digital. While I received my first digital camera (the aforementioned Game Boy Camera) on my birthday in 2000, it wasn’t until the following summer that I got my first “real” digicam, a Nikon Coolpix 775.
From there, the flood of digital photos began. Initially, I just dumped every photo into a single folder on my shiny, new, gonna-help-me-do-well-in-college-this-fall laptop, and let their sequential filenames (DSCN0001.JPG, 0002, etc.) do the “sorting.”
This worked for a while, until it became clear that having all of my photos in one folder was poor for both organization and performance, so I started organizing my photos using dated subfolders (e.g. photos/2001/2001 – 08-12/). This was all the organization I did for my photos, and was also how I viewed them, up until I began using photo managing software (first Picasa on Windows, later F‑Spot under Ubuntu).
While these apps excel at taking photos and turning them into a well-organized stream based on date taken, I noticed that a small handful of photos were out-of-place in the timeline.1
After spending some time puzzled by this, it occurred to me that:
- none of these photos had EXIF data
- all of these were taken in 2001
- all of these had been taken in “portrait” mode (when you turn the camera sideways), as opposed to “landscape”
In an example of clearly misguided, youthful indiscretion, I had manually rotated these photos — remember, cameras didn’t have orientation sensors back then — using Windows Picture & Fax Viewer (Windows ME/XP’s default), and it ate my photos’ EXIF data! From then on, I started using the camera’s built-in rotate functionality.
But, ugh, I still had a bunch of old, messed up photos. Fortunately, I wasn’t totally in the dark about these photos’ chronology, as I knew the correct dates that these photos were taken, thanks to the surrounding sequential photos still having their EXIF data.
For the last few years, I let these few photos just be, annoyed that they would always show up in the wrong places. So today, I finally did something about this: I gave them new EXIF data using the best information I had at my disposal.
While I didn’t know the precise time taken, I did have dates for these photos, so I figured giving them EXIF with the right date and wrong time was better than no date at all. I accomplished this using a pair of Linux programs: jhead and touch. Here’s how:
First, I created an EXIF tag for a given photo using jhead:
$ jhead -mkexif DSCN1282.JPG
Then, I touched the file (in Unix‑y parlance, change the file’s “modified” timestamp) to midnight (00:00:00) on the appropriate date (e.g. August 12, 2001):
$ touch -t 200108120000.00 DSCN1228.JPG
Finally, I used jhead to change the file’s EXIF timestamp to the newly-fixed modified date:
$ jhead -dsft DSCN1282.JPG
Having re-added the problem images to my F‑Spot library, the photos now appear more-or-less in the place they should. They’re now good enough that I’ll never again have to see those photos mixed in with the wrong year!
- I know what you’re thinking: that there were times when I forgot to set the date on my camera. Nope. No way. I never forget to set the date on my camera, because making sure my photos have the correct date and time is something that I’m a bit obsessive about, and the first thing I do after charging my camera’s battery is always check the date.[↩]