Here I am again. I haven’t written anything smart for a while now because I’ve been working on my next Windows Phone application called Photo Light. It should be out in less than 10 days, and it will be a small, light and free photo editor. One of the things it does is display EXIF data of the loaded photo. In this article, I’ll describe how to read the EXIF data for a photo and display it in a page. Let’s get started.

First of all, to get the EXIF of a photo, we need to get a photo. To do that, we use a PhotoChooserTask object which returns us the chosen photo. Then we need a way to read the EXIF data from the returned stream. What’s the problem here? Well, the problem is how to get that data. There is a cute little library that does the job. It’s called ExifLib and it’s available on Code Project under Code Project Open License. But don’t go downloading it yet! The version that’s on Code Project won’t do the job, because we’re not working strictly with files and file names, which the library requests, but with the stream of data given back from the PhotoChooserTask. In order to get it to work with Windows Phone, go to the blog post of Tim Heuer who did a slight modification of the library to work with WP7. Download his project and get the library from Libs folder! Add it to your newly created Windows Phone project.  When the application launches, launch the PhotoChooserTask. It will return you the chosen photo, which you can then use to create JpegInfo object and get all the info for the selected JPEG. Here’s how it looks in the end:

exif

You’ll notice that a lot of information is missing, but it will work better once you try it on the phone with a photo you’ve taken with the camera!

Here’s the layout XAML from MainPage.xaml:

And here’s the MainPage.xaml.cs, the code behind:

So, now you know how to get the EXIF data for the pictures on your phone. I hope this was helpful. You will be able to find EXIF data reader in my Photo Light application that will be published and available in less than 10 days. I will make sure you know about it when it gets published, just follow my blog. :)