To Mac and back again

12.02.2011 23:33

I used to be a Mac user. I enjoyed using my Powerbook G4 running OS X Panther and I have fond memories of it. Before things got sour that is.

Recently I remembered that that laptop, now gathering dust in a drawer, holds many files I still care about. Past projects from the Faculty, photos, old documents, all remaining to be stored in a single copy on an aging hard drive that hasn't spun in years (I noticed a while ago my last backup on an external drive got corrupted - for an unknown reason a file in a compressed set went missing)

So I powered it up, copied the files to my current computer - and was left with two home directories three years apart that needed merging. Some of the stuff I already copied from the Mac as I needed it. Some was later modified. Some was simply duplicated in different places. Do you see where this is going? In hindsight I would have saved myself a lot of work if I simply moved everything off the computer as soon as I stopped using it.

There are tools like fdupes that attempt to find duplicate files and offer to delete or hard-link the copy. But of course, it can't be that simple.

The culprit is modern software that is too smart and modifies files it shouldn't really touch. F-spot will for instance modify EXIF data in images it tracks in its library. On the other side, iTunes on Mac modifies ID3 tags in audio files it sees. Solution? Lots of shell scripting to strip metadata from files before comparing them (ExifTool and id3v3 came handy).

Speaking of images, it turned out that at some point the clock in my camera got reset to 2001-01-01 and I made around a hundred photos before noticing, which means all the dates in EXIF data have an unknown offset. Before moving everything to F-spot I wanted to correct that. Browsing through the collection I found several shots from the FOWA 2007 conference. I thought that maybe if I could find a schedule and find that particular lecture I could calculate the clock offset and correct it.

Well, scratch that idea. FOWA 2007 may have well never happened as far as the official conference site is concerned and my blog post about it came on top of most Google searches I tried. I did however find the exact same shot as I did on Flickr. From several cameras in fact, and their EXIF dates all agreed on the time to within a couple of minutes. So hurray for multitudes of redundant photos on the web!

At this point I should also mention that iPhoto stores dates in seconds since 2001-01-01 in the DateAsTimerInterval field in AlbumData.xml file (which is NOT the UNIX timestamp format, as some people on the Internet would have you believe). Here's a Python snippet to convert it to something more sane:

import datetime
print datetime(2001,1,1) + timedelta(seconds=DateAsTimerInterval)

By the way, I'm not the first one to go on this path. Donald seemed to have done the same hundred steps himself and wrote the iphoto2fspot. I didn't use it though because my F-spot collection is organized in a completely different way than what I had in iPhoto and most of the metadata there was useless anyway. Also, it parses the XML file with a regular expression.

Posted by Tomaž | Categories: Life

Add a new comment

(No HTML tags allowed. Separate paragraphs with a blank line.)