iPhoto has an undocumented "Rebuild libary" option. Press Shift-Option while starting up iPhoto to invoke it, and you will get a rather scary message about possible loss of data if there is any unreadable data. Clicking OK will allow you to select a new location for your library (make sure you have enough space). I used this and found a number of interesting things that happened:
- There were a number of orphan JPG thumbnails in the "thumb" folders that were cleaned up (deleted in the new duplicate library.)
- Albums were maintained but "rolls" were completely renumbered starting from one.
- Some rolls that apparently had no date information were put at the end of the library with the current date. This did not result in lost data but did mess up the roughly chronological flow of my library.
- The resulting library is 2 MB smaller than before (mostly due to cleaned up thumbs and smaller .data files.
- It takes a very long time, is non-destructive to the current library and requires space on the disk for a complete second copy.
- By editing the iPhoto preferences file, I could revert back to my old library (whew!).
[
robg adds: As far as I can tell, this isn't mentioned in Help at all, and I'm not sure when you might wish to use it -- in the event the Library becomes unreadable?]