I sometimes travel with an Eee PC 901 "netbook" when I want something lighter than my 12" PowerBook, but more capable than my iPod Touch. F-Spot, the photo management progarm I use on the Eee PC, can embed photo comments in EXIF.UserComment tags in the JPEG files, if you add the Exiflow plug-in. However, iPhoto'08 (version 7.1.5) does not copy those comments when the photos are imported. I discovered, though, that iPhoto will copy ITPC Caption tags into its Description field.
I wrote a bash script which reads the content of EXIF UserComment tags in JPEG files, and inserts that content into ITPC Caption tags, which will then be read by iPhoto when the photos are imported. Here's the code:
#! /bin/bash
# read EXIF UserComment in each jpg and write it to ITPC Caption
#
# Usage: exif_comments2iptc *.jpg
# or: exif_comments2iptc file_name1.jpg file_name2.jpg ...
#
# exiv2 must be present on the machine where the script is run
# http://www.exiv2.org/
# http://pdb.finkproject.org/pdb/package.php/exiv2
# http://trac.macports.org/browser/trunk/dports/graphics/exiv2/Portfile
#
# script by Kevin Horton - released into the public domain
if [[ $# -lt 1 ]]; then
echo "Usage: exif_comments2iptc one or more jpg file names ..."
exit 1
fi
pattern="Exif comment : (.+)"
for file_name
do
if [[ `exiv2 $file_name` =~ $pattern ]]; then
comment=${BASH_REMATCH[1]}
echo "File: $file_name has comment: $comment"
`exiv2 -k -M"add Iptc.Application2.Caption ${BASH_REMATCH[1]}" $file_name`
else
echo "No comment in $file_name"
fi
done
Mac OS X Hints
http://hints.macworld.com/article.php?story=20090616075113588