I setup a pretty simple and automated way to do this with lightbox or floatbox. Sample of what it looks like: http://dave.jp/my-gallery/temples-and-shrines-2
I modified /admin/functions.php so it automatically populates new photo descriptions. I just need to upload a new image or select “Import Meta data” for selected thumbs in the nextgen gallery admin panel to get the descriptions updated. It is simple this way. I also added tags to description.
in admin/functions.php go to this code:
foreach($imagesIds as $pic_id) {
$picture = nggdb::find_image($pic_id);
if (!$picture->error) {
$meta = nggAdmin::get_MetaData($picture->imagePath);
// get the title
if (!$alttext = $meta['title'])
$alttext = $picture->alttext;
// get the caption / description field
if (!$description = $meta['caption'])
$description = $picture->description;
// get the file date/time from exif
$timestamp = $meta['timestamp'];
// update database
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $pic_id) );
// add the tags
if ($meta['keywords']) {
$taglist = explode(',', $meta['keywords']);
wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
} // add tags
}// error check
} // foreach
return true;
}
// **************************************************************
function get_MetaData($picPath) {
// must be Gallery absPath + filename
require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
$meta = array();
$pdata = new nggMeta($picPath);
$meta['title'] = $pdata->get_META('title');
$meta['caption'] = $pdata->get_META('caption');
$meta['keywords'] = $pdata->get_META('keywords');
$meta['timestamp'] = $pdata->get_date_time();
return $meta;
}
I changed mine to look like this:
foreach($imagesIds as $pic_id) {
$picture = nggdb::find_image($pic_id);
if (!$picture->error) {
$meta = nggAdmin::get_MetaData($picture->imagePath);
// get the title
if (!$alttext = $meta['title'])
$alttext = ($meta['keywords'] . " " . $meta['camera']);
// get the caption / description field
if (!$description = $meta['caption'])
$description = ($meta['exif_desc'] . "" . $meta['keywords']);
// get the file date/time from exif
$timestamp = $meta['timestamp'];
// update database
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $pic_id) );
// add the tags
if ($meta['keywords']) {
$taglist = explode(',', $meta['keywords']);
wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
} // add tags
}// error check
} // foreach
return true;
}
// **************************************************************
function get_MetaData($picPath) {
// must be Gallery absPath + filename
require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
$meta = array();
$pdata = new nggMeta($picPath);
$meta['title'] = $pdata->get_META('title');
$meta['caption'] = $pdata->get_META('caption');
$meta['keywords'] = $pdata->get_META('keywords');
$meta['timestamp'] = $pdata->get_date_time();
$meta['exif_desc'] = ($pdata->get_META('camera') . ", " . $pdata->get_META('focal_length') . ", " . $pdata->get_META('shutter_speed') . ", " . $pdata->get_META('aperture') . ", ISO " . $pdata->get_META('iso') . ", " . $pdata->get_META('created_timestamp'));
return $meta;
}
(Note, there should be a properly formatted "< br / >" inside the empty quotes in '$description = ($meta['exif_desc'] . "
" . $meta['keywords']);'
above... I can't get the br to stick when posting. )
After updating functions.php as above, upload a new image, or just click on a thumb in the nextgen gallery admin panel and select “import metadata” from the drop down and click ok. You will see description field update with the exif and tags. You can still manually edit for certain images if you want to. This descrition should populate exif into lightbox, or floatbox in my case.
You will see a "/br" in the admin panel description text box, that is there to force a line break/carriage return between exif data and tags. You can easily take that and the tags out of the code of course.
I use floatbox, but it should work similar in lightbox as shown in my example: http://dave.jp/my-gallery/temples-and-shrines-2