title: Determine orientation of photos in JavaScript?
body: <p>We're using <code>FileReader</code> to get an image, from a photo taken on an iPhone, into the browser. We then use <code>drawImage()</code> to draw that image onto a <code>canvas</code>. The problem is that photos taken on an iPhone display rotated on the page. We can't reproduce this on any Android devices.</p>
  
  <p>We can rotate the image on the <code>canvas</code> easily enough but how can we determine the required rotation?  We tried some EXIF-reading libraries for JavaScript (<a href="https://github.com/jseidelin/exif-js" rel="nofollow">exif.js</a>) but were unable to successfully read the orientation.</p>