title: JPEG - reading focal length from file
body: <p>While researching for a new camera, I thought it would be interesting to generate an overview over the most common settings I have used in the past in my pictures. I'm mainly interested in retrieving the focal length used in the picture. Though aperture / iso / shutterspeed would be welcome, too.</p>
  
  <p>Having used different cameras for the past 10 years though, I would need to convert it too a 35mm equivalent format for comparison. I know this is a function of the sensor size, specifically sensor crop factor times focal length. </p>
  
  <p>Searcing around I didn't manage to find a jpeg file format header. I learned you can find most of those at a site called wotsit.org but apparantly I can't download anything from there. I know next to nothing about jpeg files, but I'm pretty sure they use exif format to hold image metadata, that I'm looking for.</p>
  
  <p><a href="http://www.exif.org/Exif2-1.PDF" rel="nofollow">http://www.exif.org/Exif2-1.PDF</a>, page 49, shows focal length is stored as a rational* number, somewhere. But I'm having a hard time grasping the structure and applying it in code. Besides, to calculate the equivalent 35mm ratio, i would have to know the camera's sensor size, which i can't find in that documentation.</p>
  
  <p>Would someone be able to give a hint / point me in the direction to the actual structure of the jpeg / exif file? I will be using C++ for this project. I know this must be possible, windows shows the 35mm eqv. of my pictures.</p>
  
  <p>*This seems to be two ulongs which represent a fraction, that, when divided, gives the     focal length?</p>
  
  <p>TL;DR: How to extract the focal length and sensor size from a jpeg file in order to compute the 35mm equivalent focal length?</p>
  
  <p>Thanks!</p>