How Windows ate my EXIF data (and how I mostly fixed it)

The background

As we’ve already estab­lished, I love to take pho­tos, and I have a strong bias toward dig­i­tal. While I received my first dig­i­tal cam­era (the afore­men­tioned Game Boy Cam­era) on my birth­day in 2000, it was­n’t until the fol­low­ing sum­mer that I got my first “real” digi­cam, a Nikon Coolpix 775.

From there, the flood of dig­i­tal pho­tos began. Ini­tial­ly, I just dumped every pho­to into a sin­gle fold­er on my shiny, new, gonna-help-me-do-well-in-college-this-fall lap­top, and let their sequen­tial file­names (DSCN0001.JPG, 0002, etc.) do the “sort­ing.”

This worked for a while, until it became clear that hav­ing all of my pho­tos in one fold­er was poor for both orga­ni­za­tion and per­for­mance, so I start­ed orga­niz­ing my pho­tos using dat­ed sub­fold­ers (e.g. photos/2001/2001 – 08-12/). This was all the orga­ni­za­tion I did for my pho­tos, and was also how  I viewed them, up until I began using pho­to man­ag­ing soft­ware (first Picasa on Win­dows, lat­er F‑Spot under Ubuntu).

The problem

While these apps excel at tak­ing pho­tos and turn­ing them into a well-organized stream based on date tak­en, I noticed that a small hand­ful of pho­tos were out-of-place in the time­line.1

After spend­ing some time puz­zled by this, it occurred to me that:

  1. none of these pho­tos had EXIF data
  2. all of these were tak­en in 2001
  3. all of these had been tak­en in “por­trait” mode (when you turn the cam­era side­ways), as opposed to “land­scape”

In an exam­ple of clear­ly mis­guid­ed, youth­ful indis­cre­tion, I had man­u­al­ly rotat­ed these pho­tos — remem­ber, cam­eras did­n’t have ori­en­ta­tion sen­sors back then — using Win­dows Pic­ture & Fax View­er (Win­dows ME/XP’s default), and it ate my pho­tos’ EXIF data! From then on, I start­ed using the cam­er­a’s built-in rotate functionality.

But, ugh, I still had a bunch of old, messed up pho­tos. For­tu­nate­ly, I was­n’t total­ly in the dark about these pho­tos’ chronol­o­gy, as I knew the cor­rect dates that these pho­tos were tak­en, thanks to the sur­round­ing sequen­tial pho­tos still hav­ing their EXIF data.

The solution

For the last few years, I let these few pho­tos just be, annoyed that they would always show up in the wrong places. So today, I final­ly did some­thing about this: I gave them new EXIF data using the best infor­ma­tion I had at my disposal.

While I did­n’t know the pre­cise time tak­en, I did have dates for these pho­tos, so I fig­ured giv­ing them EXIF with the right date and wrong time was bet­ter than no date at all. I accom­plished this using a pair of Lin­ux pro­grams: jhead and touch. Here’s how:

First, I cre­at­ed an EXIF tag for a giv­en pho­to using jhead:

$ jhead -mkexif DSCN1282.JPG

Then, I touched the file (in Unix‑y par­lance, change the file’s “mod­i­fied” time­stamp) to mid­night (00:00:00) on the appro­pri­ate date (e.g. August 122001):

$ touch -t 200108120000.00 DSCN1228.JPG

Final­ly, I used jhead to change the file’s EXIF time­stamp to the newly-fixed mod­i­fied date:

$ jhead -dsft DSCN1282.JPG

Hav­ing re-added the prob­lem images to my F‑Spot library, the pho­tos now appear more-or-less in the place they should. They’re now good enough that I’ll nev­er again have to see those pho­tos mixed in with the wrong year!


  1. I know what you’re think­ing: that there were times when I for­got to set the date on my cam­era. Nope. No way. I nev­er for­get to set the date on my cam­era, because mak­ing sure my pho­tos have the cor­rect date and time is some­thing that I’m a bit obses­sive about, and the first thing I do after charg­ing my cam­er­a’s bat­tery is always check the date.[]

One thought on “How Windows ate my EXIF data (and how I mostly fixed it)”

  1. Inter­est­ing post, espe­cial­ly because I’ve been mean­ing to ask you about this for a while. I tried using F‑Spot for again a cou­ple weeks ago and saw that a lot of pho­tos were out of place for var­i­ous rea­sons and it was dri­ving me crazy, so thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *