Forums

EXIF Information display in Lightview Plus or Lightbox (1 post)

  1. charlesleo
    Member
    Posted 2 weeks ago #

    Hi.

    Does anyone know how to accomplish this?

    I've seen it done on this page:
    http://kruyt.org/

    He specifies the code below: but where does he put it?!?!?!

    What I mean with thickbox, is I auto load it in the plugin. no need to embed in my theme. And thickbox is already by default in WP2.5

    code for using the tb in wp:

    wp_enqueue_script('thickbox');
    add_action('wp_head', 'thickbox_css');
    
    function thickbox_css() {
    
        $thickbox_csspath = get_bloginfo('wpurl')."/wp-includes/js/thickbox/thickbox.css";
        $thickboxscript = "\n";
        print($thickboxscript);
    }

    Then:

    And here some code I use to put the exif info that wp 2.5 now reads from files in the title, so the ‘boxes’ can use it to. To display exif.

    // Get EXIF from WP and set in title
    $metadata = wp_get_attachment_metadata($id);
    $image_meta = $metadata[image_meta];
    
    //print_r ($metadata);
    
    if($image_meta[camera]) $title = ”.$image_meta[camera].’ ‘;
    if($image_meta[focal_length]) $title .= ‘@ ‘.$image_meta[focal_length].’ mm ‘;
    if($image_meta[shutter_speed]) $title .= ‘- ¹/’.(1/($image_meta[shutter_speed])).’ sec’;
    if($image_meta[aperture]) $title .= ‘, ƒ/’.$image_meta[aperture].”;
    if($image_meta[iso]) $title .= ‘, ISO ‘.$image_meta[iso].”;
    if($image_meta[created_timestamp]) $title .= ‘ on ‘.date(’j F, Y’,$image_meta[created_timestamp]).”;

Reply

You must log in to post.

About this Topic