title: Rotate and scale image to "fit" container div
body: <p>I'm using <code>transform</code> to rotate an image according to its EXIF data. Then, I'd like to display it "full screen" by fitting it to its parent div.</p>
  
  <p>The problem is, <code>max-width</code> / <code>max-height</code> and all other sizing directives "ignore" the rotation (which is normal, according to <code>transform</code> specs, the element's transformation is "ignored" in the flow.</p>
  
  <p>Jsfiddle: <a href="http://jsfiddle.net/puddjm4y/2/" rel="noreferrer">http://jsfiddle.net/puddjm4y/2/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div.top {
      position: fixed;
      width: 100%;
      height: 100%;
      border: 1px solid blue;
  }
  img {
      transform: rotate(90deg);
      max-width: 100%;
      max-height: 100%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="top"&gt;
      &lt;img src="http://www.androidpolice.com/wp-content/uploads/2014/02/nexusae0_wm_DSC02232.jpg"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is there a way to achieve this?</p>