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

The background

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).

The problem

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:

  1. none of these photos had EXIF data
  2. all of these were taken in 2001
  3. 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.

The solution

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!

  1. 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.[]

The plugins behind the blog

I appreciate the slick publishing platform that WordPress provides for my writing. Perhaps even better is its plugin system, which lets me make it do just about anything I like.

Since you wont find me churning out PHP code of my own anytime soon (I’ve actually been meaning to take another stab at to wrapping my brain around Python now that version 3 is out), I rely on the WordPress community to do so for me. Fortunately, with nearly 10,000 plugins available, they seem up to the task!

When I set up my WordPress installation earlier this year, I promised myself that I wouldn’t go overboard the way I usually end up customizing and extending most of the other tech tools/toys in my life. Even while showing restraint, I’ve managed to accumulate just over 20 plugins at this point… whoops! 1 That said, every plugin I’m using has helped make this blog what it is today… from one that mirrors comments that people post on Google Buzz, to one that gives me a per-post space to brainstorm as I compose.

Thus, I’ve created an ‘About Plugins‘ page that properly recognizes each one.

  1. The plugins actually seem to be impacting the blog’s performance; I need to take a closer look into just where the inefficiencies lie.[]

What’s all the PubSubHubBub hubbub?

Generally speaking, I’m a fan of emerging technologies and stuff like that. I just don’t always get it right off the bat.

I first heard of RSS/Atom in 2002 or 2003,  whenever LiveJournal started actively pushing syndication, making feeds on journals discoverable. I looked upon these alien terms with interest, but some confusion. Wait, I can subscribe to a blog? Why would I want to do that?

I know what I probably sounded like back then. Perhaps in a couple of years, I’ll be laughing at myself, wondering what I’d do without PubSubHubBub. Just perhaps.

For now, though, I’m not quite sure I get it. Since Google Reader now supports the format, I went ahead and found a WordPress plugin to enable it here on writegeek. I understand that to an RSS subscriber, it means faster or near-instantaneous updates. And to a publisher, it mean not only faster updates for one’s readers, but less load on the server, since millions of desktop feed-readers won’t be regularly requesting one’s RSS file. (Not that that applies to me… yet.)

Yeah, I’m a bit intrigued at the instant publishing, but have a bunch of unanswered questions. Which servers should I be pinging? What motivates one to run a server? What are their business models? A couple of years down the road, when they realize that they’re running the most popular servers but still aren’t making money, will they be putting ads in my feed? And I think I read something about servers talking to each other; how does that work?

There seems to be nothing to lose, no lock-in or single baskets in which to place all of my proverbial eggs,  so I’ll try it out. (That was basically the point of this post.)

Time to click Publish and start jabbing my F5 key…

The case of the disappearing, reappearing dictionary

I was a voracious reader from a rather early age. I recall having had my reading level, in first or second grade, assessed at that of an eighth-grader.

My reading prowess could be attributed to a few things, like my parents reading to me from a young age, and often encouraging me to read to them. More importantly, if I came across a word I didn’t know and asked them what it meant, they almost always made me go look it up in the dictionary. I had a children’s dictionary that I adored, but for words that didn’t appear in there, I’d use their musty collegiate dictionary. This fostered an environment where literally no word was beyond my comprehension, an empowering feeling for a pre-geek with a single-digit age!

As I grew up, I didn’t always manage to keep reading with such volume and tenacity, and today, while I read tons of bits and blogs from the Web, long-form content isn’t something I take in a lot of. When I do, it tends to be an e-book. (I read these, in epub format, on my Android phone using the excellent open-source FBReader. Yes, reading off of a small backlit screen sucks, but this is mitigated by a nice serif font and the knowledge that, as I’m often reading in the dark, I wouldn’t really be able to read any other way.)

As I read, still I come across the occasional word I don’t know. These days, my main dictionary (either Free Dictionary Org or Lexicon Lite) also lives inside of my phone. FBReader doesn’t have its own built-in, and to switch to another app is kind of a pain, so I’ve lately been finding myself shrugging off unknown terms. I have become the sort of person who stopped learning new words.

This bothered me, so I decided that, damn the inconvenience, I would start looking up words again. Once I tried, I learned that it actually wasn’t so hard, after all.

The secret (if you could call it that) was to long-hold my phone’s Home button. This is the equivalent to the Alt+Tab key combination in Linux and Windows, which allows you to flip through open apps (only, in Android, it’s a list of the six most recently used apps, open or otherwise). As long as the dictionary is among the last six, it’ll appear in that list… as does FBReader, when it’s time to switch back. This is much more enjoyable than going back to the home screen, flipping open the apps drawer, etc.

I guess that’s a passable not-so-new-anymore year’s resolution: to leave no word un-lexicized.

More introduction (this time, the geek side)

I understand that self-identifying as a geek in 2010 makes me neither cool nor special, now that geeks are considered… you know… cool and special. But having laid out my blogging cred, I’d still like to make the case for the geek side of the equation (equations being something I actually know very little about).

Yep, a distaste for mathematics curtailed dreams of studying computer science, or something along those lines, in college. Back in middle school, however, I was happily hacking BASIC in my school’s Apple //e lab. I had sort of a knack for it; in computer class, I raced through the packet of programs we were required to transcribe faster than anyone else, and began spending my time writing my own programs, which would do things like tell my friend that his favorite football team sucked, repeatedly, through the magic of 20 GOTO 10.

I didn’t really apply this knowledge very well at the time; it would still be a couple of years before I had a computer at home. And even when I finally did, a completely awesome Pentium 166 MHz IBM Aptiva1 running Windows 95, I didn’t quite know how to get started programming on it.2

Another device appeared in my life a few years after the computer; I received a TI-83 graphing calculator for use in Algebra II. I initially found that it made a great mobile Tetris machine, but it wasn’t until reading Bill Gates’ The Road Ahead, in which he recounted his early days programming primitive computers, that I found myself inspired to do more with it.3

The calculator seemed like a good place to start programming, especially because the user manual contained an entire chapter devoted to teaching the TI-BASIC language! I picked this up pretty quickly, since I still remembered a lot of concepts from Apple BASIC. In my junior year of high school, I was soon writing programs to help me take shortcuts to solving math and science problems. But most importantly, I wanted to make games.

So I made a game. How I did so could be its own entry, and very well may be in the future.

This inspired me to sign up for the Computer Programming I elective in my senior year. They taught us Visual Basic, and the class was neither interesting nor fun. This, paired with the realization that studying computer science in college meant taking lots of math (something I’d always heard, but college course catalogs assured), made it clear that I should focus on the other thing I liked doing: writing.

I majored in communications, and the rest is history. Except for a fruitless foray into Python a couple of years ago, I haven’t programmed much lately.

But I still embody, I think, the hacker ethos. For me, 2005 could also have been called the mythical Year of Linux on the Desktop, thanks to the then-nascent, but still quite amazing, Ubuntu distribution. While it was alien to me, and didn’t quite ‘just work’ on my laptop, I persevered (smug Windows-using friends would say I “suffered”) and use it to this day. I love Ubuntu, and it still… almost just works.

Along the same geek lines, doing more with the devices I own seems to be a recurring theme in my life. These days. I carry in my pocket a rooted Android phone (running CyanogenMod), and at home have a homebrew-enabled Nintendo Wii and DS, a Canon PowerShot sporting CHDK, and Linksys routers running the dd-wrt and Tomato firmwares. My (lack of) skill-set means that you won’t find me helping the cause of hacking open a new device, but I’m glad to file the occasional bug. In short, I like to get as much as possible out of my devices, including, quite literally, my data. Backup is a topic I’ll be coming back to, for sure.

I think that about sums up my geek side (and unintentionally makes a pretty good case for my navel-gazing side).

  1. Mine looked exactly like the tower pictured there![]
  2. Let’s remember this when we talk about the iPad.[]
  3. My 2010-self is a little embarrassed by having drawn geekspiration from Bill Gates, but you’re reading a truthful blog.[]