[Hacking Mac]: iPhoto Structure

[Update]: See updated iPhoto SQL structure page for more recent information from digging around, or here.

Spent some more time working out how iPhoto works. Here is some of what appears to be going on. By the way, I’m using iPhoto ’09, just for reference.

The default iPhoto library is stored in the “~/Pictures/iPhoto Library”. I’m going to refer to this from now on just as “iPhoto Library”. This is a package, so you will need to tell Finder to open the package contents so that you can see inside. From the command line, you can just change (cd) right into the directory. There are some files such as AlbumData.xml that contain an XML description of the iPhoto database. The one thing to note is that this file is basically just written out for reference. It doesn’t actually get read in. There is a good write-up of the different files that iPhoto uses here. (Fat Cat software makes an application called iPhoto Library Manager that sounds nice, but not quite what I’m looking for.) The iPhoto Library sits in “iPhoto Library/iPhotoMain.db”. It’s an SQLite3 database.

I’m not importing my images into the library and I’m mainly concerned with the original files to update the locations, so I’m less interested in the data directories “Data”,”Originals”, and “Modified”

For reference, there are also a couple of options for starting iPhoto.
First, you can select a different library when iPhoto starts up.
Second, you can run maintenance on the iPhoto Library.


[Hacking Mac]: iPhoto Images

See here for more information regarding iPhoto database

I want to move my iPhoto images from one directory to a different one on the file system. I currently have them imported to iPhoto by reference so they have not been copied into iPhoto itself. I don’t want them all imported to the iPhoto Library because I have them on a shared server. I can’t find a way to batch move all of the images in an event or album.

One thing that I can do is to move them, and then re-locate the image when I try to access them in iPhoto but that is a huge pain. I don’t want to re-import them because many of them have metadata associated with the image in iPhoto, and these would then be lost.

Normally, this would not be a big deal, but it appears that all of the image properties are read-only through the Applescript API. Ugh, sometimes I hate Apple. I just want to move where the images are located on the disk. Why does this have to be so hard…