iPhoto To SQL
is an export plugin for iPhoto that will create an SQL dump file with all picture metadata in addition to creating scaled images and thumbnails. If you've written your own photo gallery software, use this to get your photos and associated metadata into your database backend.
iPhoto To SQL will create the following fields: id, title, comment, keywords, stars, date, album, thumbnail filename and image filename. You can set height/width maximums on the thumbnails and images and they will be rescaled with their aspect ratio preserved.