Title: Retrieving Exif Data
Last modified: August 20, 2016

---

# Retrieving Exif Data

 *  Resolved [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/)
 * I am trying to create a photoblog theme, and what I wnat to do is have the photo
   in one <div> and the relevant exif data for it in another <div> to the right.
   I am pretty sure that WP extracts and stores the exif date when an image is uploaded,
   but I am damned if I can find where it stores the info, or how I can pull it 
   out for use.
 * Would very much appreciate any ideas…

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [i_g_wright](https://wordpress.org/support/users/i_g_wright/)
 * (@i_g_wright)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/#post-2437081)
 * Hi,
 * This website should help you out: [http://www.bloggingtips.com/2008/07/20/wordpress-gallery-and-exif/](http://www.bloggingtips.com/2008/07/20/wordpress-gallery-and-exif/)
 * Thank you,
 *  Thread Starter [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/#post-2437093)
 * Thanks for that i_g_wright, I have read that through several times, and tried
   most of what is suggested, but it only seems to work in the context of a gallery
   which is not what I am trying to do.
 * What I am trying tp do is have a single post with a photo and the exif data next
   to it with next and previous links to work forwards and backwards through the
   images. At this point everything I try returns no information at all. My thinking
   is that when WP (on uploading) creates smaller images it wipes out the exif data
   on these smaller images, which has to be retrieved from the original image, and
   that is what I can’t get my head around right now.
 *  [i_g_wright](https://wordpress.org/support/users/i_g_wright/)
 * (@i_g_wright)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/#post-2437318)
 * Hi,
 * Ok, in your single post template (PHP file) you should be able to use the following
   code:
 *     ```
       <h1>Attached Images & Exit Data</h1>
       <?php
       $args = array(
          'post_type' => 'attachment',
          'numberposts' => -1,
          'post_status' => null,
          'order'	=> 'ASC',
          'post_parent' => $post->ID
         );
       ```
   
 *     ```
       $attachments = get_posts( $args );
            if ( $attachments ) {
               foreach ( $attachments as $attachment ) {
                  $imgmeta = wp_get_attachment_metadata( $attachment->ID );
                  echo '<pre>';
                  print_r( $imgmeta );
                  echo '</pre>';
                 }
            }
       ?>
       ```
   
 * This code will print out an array of all the image sizes available and the image
   exif data.
 * To print out each item separately you can use the following formats (As stated
   from the website above)
 * $imgmeta[‘image_meta’][‘aperture’]
    $imgmeta[‘image_meta’][‘credit’] $imgmeta[‘
   image_meta’][‘camera’] $imgmeta[‘image_meta’][‘caption’] $imgmeta[‘image_meta’][‘
   created_timestamp’] $imgmeta[‘image_meta’][‘copyright’] $imgmeta[‘image_meta’][‘
   focal_length’] $imgmeta[‘image_meta’][‘iso’] $imgmeta[‘image_meta’][‘shutter_speed’]
   $imgmeta[‘image_meta’][‘title’]
 * I hope that helps,
 *  Thread Starter [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/#post-2437346)
 * Thanks i_g you’re a genius, that works perfectly…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Retrieving Exif Data’ is closed to new replies.

## Tags

 * [exif](https://wordpress.org/support/topic-tag/exif/)
 * [meta-data](https://wordpress.org/support/topic-tag/meta-data/)

 * 4 replies
 * 2 participants
 * Last reply from: [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/retrieving-exif-data/#post-2437346)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
