iPhoto Library Manager Icon

The AlbumData.xml file

One of the files that iPhoto keeps inside its library folder is a file named "AlbumData.xml". This file is written out by iPhoto so that other applications, such as iMovie and iTunes, can read it and tell what photos and albums are in your photo library. iPhoto Library Manager also reads this file in order to display what albums are in your photo library.

The AlbumData.xml file is only written out by iPhoto, it is never read back in, so you cannot modify it as a way of changing information in your library. In fact, the next time iPhoto writes out the file, it will wipe out any changes that have been made.

There are some instances where iPhoto will write out malformed data to the AlbumData.xml file, causing other applications to be unable to read the file correctly. This will result in iPhoto Library Manager displaying an error message reading ""The album data file for this library is malformed" (with some additional details) in the list where the library's albums are usually displayed. Other applications such as iMovie and iWeb, in their interface for accessing iPhoto's files, will typically display a message such as "Launch iPhoto 2 or later to populate this list."

The most common cause of a malformed AlbumData.xml is the presence of an ampersand (&) character somewhere in the path of the iPhoto library folder. This can include the name of any folder that contains the library or the name of the disk that the library is on. If this is the case, first quit iPhoto, then go rename the folder or disk to remove the ampersand character. When you switch back to iPhoto Library Manager, it will detect the renaming and the path in the Location field on the right will update. You will then have to open up the library in iPhoto, change something in the library (such as adding a new album), and close it again to get iPhoto to write out the file again with the new, non-problematic path.

Other causes are usually due to a special character being present somewhere in the iPhoto library itself and being written out incorrectly to the file, messing up the XML formatting. Special characters include punctuation and invisible characters that aren't normally displayed when drawing text. However, there are many different places that these characters can show up in the iPhoto library, though, so it is often difficult to find the offending data just by strolling through your library looking for it. Further complicating the matter is the fact that iPhoto does handle these characters correctly in some places, but not in others, and sometimes a bug will cause a problem in one version of iPhoto, but be fixed in a later version.

Advanced Troubleshooting

If you want to try to find the item in your library that is causing the problem, follow these steps as a general guide:

  1. The error message displayed in iPhoto Library Manager, after saying "The album data file for this library is malformed", should then read "XML parser error:", followed by a more specific error that specifies a line number. Take note of that line number
  2. Select the library in question, click the Reveal In Finder button to show the library folder, then double click the folder to look at the library's contents. The AlbumData.xml file should be inside.
  3. Open the AlbumData.xml using a text editor that has a function that will allow you to jump to a particular line number in a file. Microsoft Word provides this function, as does the free text editor TextWrangler.
  4. Once the file is open, jump to the line that is specified in the iPhoto Library Manager error message.

You have now found the point in the file where the data is malformed. From here, the exact steps to actually fix the problem can differ, depending on what part of the file the error is in.

If you see a line reading "<key>List of Keywords</key>" not too far up from your position in the file, then the problem is with one of your keywords. Open your library in iPhoto, open the preferences window, and go to the keyword list. Double click on the offending keyword to rename it, and just re-type the name of the keyword to get rid of any invisible characters that might be in the keyword's name.

If the problem is located in a record for a particular photos (you should see lines for properties such as "MediaType", "Caption", "Comment", etc.), then you can either go to that photo in your library and try to edit the photo's information, or you can just remove that photo from your library altogether and re-add it later. Finding the photo can sometimes be tricky, especially if the bad data prevent's the photo's title or filename from being written out to the file.

If you have any problems finding the error on your own, feel free to send a copy of your AlbumData.xml to iplm_support@mac.com to get further assistance.

See also:

About the iPhoto library folder

Accessing libraries from other applications

The "Use XML Info Only" option

iPhoto metadata