Numeric Illustration

How to export photos from an iDVD project

Posted in Uncategorized by elevatorboy on January 26, 2013

I needed to get a copy of the photos I had used in an idvd project. I discovered that iDVD doesn’t have an export feature that gives this output. You can view the project info and see a list of the photos, but cannot select the whole list and copy it.

You can however get the listing in another way.

Inside the project container is a plist file called
ProjectData

Unfortunately it is in binary plist format and its not so easy to extract the file names from that. However there is a system utility to convert plist files to and from various formats including binary and xml. So if I convert it to xml, I can regex out what I want, and feed that to cp to make an export.

say my project was called cool_project. Then the plist file is at:
~/Documents/DVD_Projects/cool_project.dvdproj/Contents/Resources/ProjectData

Convert it to xml with plutil:
plutil -convert xml1 ~/Documents/DVD_Projects/cool_project.dvdproj/Contents/Resources/ProjectData -o ~/output.plist

I have an XML plist file that I can more easily work with. Because all I care about is the images and other media, I extracted out the iTunes path listings, cleaned them up a bit with regex in vim to end with a file containing only a listing of file paths with the spaces escaped. Then I fed that list to the following shell command to copy all the pictures to a folder:
mkdir ~/DVD_EXPORT; while read picture; do cp "$picture" DVD_EXPORT/ ; done <photo_list.txt

Also a few of the references to iTunes audio files were not found so I fixed the paths to them and then converted the plist back to binary and stuck it back in the project folder like so: plutil -convert binary1 output.plist -o output.binary
cp output.binary Documents/DVD_Projects/cool_project.dvdproj/Contents/Resources/ProjectData

UPDATE:
A revised version with some bash command substitution, some sed editing, and a loop that you can put all on one line would go something like: mkdir ~/DVD_EXPORT; for picture in $(plutil -convert xml1 ~/Documents/DVD_Projects/cool_project.dvdproj/Contents/Resources/ProjectData -o - | sed -n -e 's/\(\<string\>\)\(\/Users\/MY_USER_NAME.*\)\(\<\/string\>\)/\2/p' ./SA_T.plist | sed 's/ /\\ /g') ; do cp "$picture" ~/DVD_EXPORT/ ; done

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: