title: extract exif orientation data from image
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7584794/accessing-jpeg-exif-rotation-data-in-javascript-on-the-client-side">Accessing JPEG EXIF rotation data in Javascript on the client side</a>  </p>
  </blockquote>
  
  
  
  <p>I'd need to extract the orientation EXIF data from an HTML JPEG image with Javascript.</p>
  
  <p>according to <a href="https://exiftool.org/TagNames/EXIF.html" rel="nofollow noreferrer">exiftool's documentation</a> the orientation flag is found at offset 0x112 within the EXIF marker, and occupies 2 bytes.</p>
  
  <p>I guess we just need to extract the data at good offset and 'convert' the value but i don't have any idea how to achieve this in the browser. The result value should be a number between 1 and 8 describing the orientation.</p>
  
  <p>How to read that data from a simple IMG tag ?
  I need a webkit only solution, but browser only.</p>
  
  <p>Thanks !</p>