Rescuing Photos from iPhoto
iPhoto is one of these programs which, allegedly for the sake of ease, lies about how your photos are organised in your computer. It only confuses us all.
1 The iPhoto Confusion
It certainly got me confused, as I grew up with a filesystem sort of mind, with directories, time-sortable filenames and common search tools. Certainly, I didn't need some random program to decide for me how I organise my pictures, thank you very much. And it also confuses less computer-savvy people, those for whom Mac software is designed to begin with. The iPhoto developers seem to have got it all wrong.
Once cleaning up photos from iPhoto before moving away from it, I was bewildered to see how many gigabytes worth of duplicates there was. I sometimes found 6 copies – literally six identical files – of a given photo, just because iPhoto thought it'd be useful to give you an utterly obscure view of your photo collection.
2 Preventing It From Starting
Moving away from iPhoto first and foremost means neutralising it, keeping it at bay to make sure it doesn't do anymore harm. Rather than altogether removing it from the system – which I thought will be one of those things a Mac won't let you do and if you pull it off anyway, other things might stop working– I decided I'd just prevent it from being run accidentally again.
Find iPhoto in your Applications, right-click on it and Get Info, and under the Sharing & Permissions roll-out:
- Set the No Access privilege to everyone, who originally probably had Read only privileges.
- Remove the admin group, which the main user may belong to. This admin group originally probably had Read & Write privileges. You couldn't set its access to everyone, hence the removal.
3 iPhoto File Structure
It's all kept in /Users/<the-user>/Pictures/iPhoto Library
– thankfully. Files I found to be of interest for extracting photos out were:
- The original photo files, which are kept in the
Originals
directory. - The modified photo files, which are kept in the
Modified
directory. - The
AlbumData.xml
file is a goldmine. It contains e.g. a list of pictures, faces, and their relationships. - I didn't find in
AlbumData2.xml
anything that could be usefully used outside of iPhoto. - There are SQLite database files too, which presumably have some overlapping information with the XML file. Obviously, working with XML files using common filtering commands is easier to get an idea of how things are structured inside iPhoto.
- The
Data.noindex
file (and theData
symbolic link which refers to it) has faces, thumbnails and possibly even more.
4 Automatically Exporting Pictures from iPhoto
As a result of these investigations, I wrote the ephoto set of tools to extract so-called iPhoto rolls of pictures as well as faces into directories.
5 References
- 5 simple steps for moving away from iPhoto, which explicitly says that iPhoto Takes Your Digital Photos Captive. I couldn't have said it better.
- Duplicate Files and How to Deal With Them
- ephoto