iPhoto Tribulations, Tools & Tips

I’ve been having ongoing problems with corruption in my iPhoto library. I was up to about 14,000 photos which is well below the 250,000 image limit. Problems included locking up while importing photos and crashes when emptying the trash.

I’d do the typical iPhoto and disk repairs. They might help for a short while but then the problem would return. In short, the problems never got resolved. While my process included backups for all the photos, I didn’t back up the iPhoto library itself on a regular basis. I didn’t really want to start from scratch and the library backups I had probably included the corruption and were old.

When I got the new iMac I was hoping the problem would go away. I’d be copying the library but the software would be a nice new factory install. No such luck and the repairs still didn’t help. It was obvious real work would be needed to replace the library. My research brought me to a couple of nifty iPhoto tools and taught me some things about the way iPhoto works.

Everything below applies to iPhoto 6 which is what I have and may or may not apply to earlier versions.

Editing/Viewing in External Editor Creates Backups

If you open photos in an external editor iPhoto will create a backup, just like as if you had changed it. This was news to me. I view edit photos in Photoshop Elements. If I’m just doing a quick print or edit I don’t always save the changes. I figured I was saving disk space since iPhoto wouldn’t have to save the original. Little did I know that just opening it externally caused it to create a backup. I did wonder how it knew if the external editor made a change but didn’t think about it enough. iPhoto Diet (see below) taught me the error of my ways and corrected the problem.

Quiting When Emptying The Trash

Here’s the Apple Support Document on the issue. I do have iPhoto 6.0.1 (actually I now have iPhoto 6.0.5) and this has not been a resolution on my problem library. If I kept the contents small between empties it would work OK for considerable time but eventually start crashing again. The good news is that testing large deletions on new libraries does not cause me a problem.

Moving the iPhoto Library

Moving the iPhoto Library is very simple. The short version is to move (don’t leave it in the old location) the library to a new location then start iPhoto. It will ask for the library when it starts, just browse to the new location and pick it. Don’t leave the library in the old location, otherwise iPhoto will continue to use it. Here’s the Apple Support Document. iPhoto Library Manager (see below) can also be used to manage and move libraries.

Repairing/Rebuilding The iPhoto Library

To repair the library hold the Command and Option keys when starting iPhoto. You’ll see the following dialog box:

Screenshot of the iPhoto Repair Dialog

In my case, this (selecting the first three options and sometimes the fourth) only solved my problem temporarily. Even justrebuilding the small thumbnails takes considerable time. It depends on the number of photos and your Mac, but on my Mac Mini it would take about two hours per repair. Here”s the Apple Support Document on the rebuild function: http://docs.info.apple.com/article.html?artnum=107947

iPhoto Diet

Website: http://www.rhythmiccanvas.com/software/iphotodiet/
iPhoto Diet is a great freeware Applescript app for iPhoto. Visit the website for all the details and to download it, but here’s my experience with it.

It removed all my “Redundant Backups”, several thousand of them. This is where iPhoto saves off the original photo but the updated photo is the same as the original. This is caused (at least in my case) when a photo is opened in an external editor but no changes are saved.

It stripped the icon thumbnails from photos. I rarely view the photos in finder so I don’t need them.

It can remove “leftovers”. These are empty directories or unused files. I actually had a problem in this area which I believe was due to my database corruption. When running the Diet I received many Applescript errors for missing directories. They were in fact missing. I created them and iPhoto Diet was happy. But then iPhoto Diet removed them as leftovers. The next time Diet was run I received the Applescript errors again so I just turned off the options.

These missing directories had a common theme which takes a bit of explaining. When you drag a directory into iPhoto to import it the film roll is named with the directory name. iPhoto also creates a directory (on the filesystem) with the roll name. If a file system directory with the name already exists it appends _XX to the name (where XX is a constantly incrementing number) of the new directory. When I was organizing photos using just the file system I’d frequently have a “Fav” subdirectory to identify favorites. When I imported the photos to iPhoto I had well over 100 “Fav” rolls.

Since all of the missing directories were “Favs”. It was easy to replace them. I just had to fill in the blanks in the numbering sequence. I suspect some corruption occurred when the photos contained in those directories where deleted and some table in iPhoto still points to them even after all the repairs. I haven’t had any problems running the Diet on the new libraries I’m creating.

iPhoto Diet has an option to compare timestamps when looking for duplicates. It’s off by default but I turned it on. This didn’t work well for me. It found a lot of false matches. The timestamps did match but the photos weren’t duplicates. So I haven’t used this option since.

iPhoto Diet can move duplicates to either the trash or to a new album. I used the new album option (the default) and it’s really slick. The albums it creates are prefixed with dashes to make them easy to find. There’s an album for duplicates to keep, and one for duplicates to delete. Since the photos are listed in the same order it’s easy to switch between the two to see if they match. In this way it was obvious to me that the “Compare Timestamps” feature had many false positives. Albums are also created for Thumbnails and unassigned photos.

iPhoto diet will identify thumbnails. If the current photo and it’s backup are both thumbnail size it’s flagged as a thumbnail. If you collect thumbnails this isn’t very useful. The only thumbnails it found for me were ones I wanted. So it did work, and I could simply ignore the contents of the thumbnail album so no harm was done.

iPhoto Diet can identify unassigned photos which are ones not in any album. I mainly use smart albums so most of my photos were unassigned. So I ignored the results and turned this option off.

If you use the option to relink libraries if will recreate any albums that have a “dup to delete” and link in the “dup to keep” instead. Unless you link the new names you’ll want to drag the photos to your old albums which is what I did. This can be tedious if you have a lot of relinked albums but is easy. Because I have large “collection” albums and then many “subset” albums I had a lot of relinking. I had let iPhoto import dups because I was afraid it wouldn’t link to the album if it wasn’t imported.

The bottom line is this is a cool tool which I’ll be using regularly and was a key component of my process to rebuild my iPhoto library. Plus it’s free. Every iPhoto user should have it. While I haven’t had any problems iPhoto library backups are recommended before running anything like this.

iPhoto Library Manager

website: http://homepage.mac.com/bwebster/iphotolibrarymanager.html
iPhoto Library Manager started it’s life as a way to get around the early iPhoto limits by allowing multiple libraries. But it’s still useful today, as I found out. The free version allows managing multiple libraries and provides some additional features and limits some features. The full version is $19.95 and it’s what I needed to get around the 20 photo import limit. I used iPhoto Library Manager to move the albums and photos from my corrupt library to my new library. This worked flawlessly. I did try a 5000 photo import and iPhoto crashed as iPhoto Library Manager was updating the metadata, so I did things in smaller groups. My largest import was 3,014 photos in one batch.

It’s rebuild library feature didn’t help me resolve the original library corruption although I can’t really fault it since nothing else worked either.

It doesn’t migrate smart albums. When I copied the smart albums it created regular albums instead and linked the photos to it. This was well documented so I expected it up front. Between iPhoto Library Manager and iPhoto Diet I’m questioning my need for smart albums so I haven’t recreated them.

In Summary

I could have saved a lot of time if I stopped trying to rebuild the iPhoto database sooner and simply started to move them to a new library. Since I was unsure of iPhoto Library Manager or iPhoto Diet I spent a lot of time doing backups and doing things in small batches. I allowed iPhoto Library manager to import duplicates so I wouldn’t have any problems with the album contents. Then I used iPhoto Diet after each import to remove the duplicates and preserve the album links.

Additional Links

Here’s a link to the Apple’s iPhoto 6 Getting Started Guide (PDF file): http://manuals.info.apple.com/en/iPhoto_6_Getting_Started.pdf

Apple iPhoto webpage: http://www.apple.com/ilife/iphoto/

iPhotoToGallery: http://zwily.com/iphoto/
This is a plugin that allows you to move photos from iPhoto to gallery. I haven’t tried this as my webhost doesn’t seem to like Gallery so I haven’t been able to get it working.

Keyword Assistant For iPhoto: http://homepage.mac.com/kenferry/software.html
I just started using this. As I mentioned, I’ve used smart albums a lot in the past, many of which are based on keywords. But the iPhoto interface for keywords doesn’t scale well for large numbers of keywords. They’re just too hard to find, organize and manage. This seems like a good way around that, and it’s free. The potential “gotcha” here is that KA goes into “compatibility” mode when an untested (or new) version of iPhoto is used. As new versions of iPhoto are released we’ll need to get new versions of KA.

Picasa Web Albums can be uploaded directly from iPhoto. The iPhoto plug-in from Google is available here: http://picasa.google.com/web/mac_tools.html

1 thought on “iPhoto Tribulations, Tools & Tips”

  1. Hi there,

    I have been an enthusiastic convert from PC to IMAC.

    However I am very keen to be able to place the date that a photo was taken on the front of the image so that when I get them printed the date is there.

    It seems the brilliant IPHOTO will not let me do this – very dis-appointing.

    Whe i operated the PC I had to use a software package – TimetoPhoto – that let me do this.

    Unfortunately this software is not suitable for the IMAC.

    Is there a way in IPHOTO to achieve this ?

    If not are Apple thinking of including the facility in an IPHOTO upgrade ?



Comments are closed.

%d bloggers like this: