title: imagecreatefromjpeg not rotating image
body: <p>I'm having issues with imagecreatefromjpeg and image rotation. </p>
  
  <p>To be more specific:</p>
  
  <p>Image #1 <a href="https://dl.dropboxusercontent.com/u/9271284/stackoverflow/20160124112643911541_orig.jpg" rel="nofollow">https://dl.dropboxusercontent.com/u/9271284/stackoverflow/20160124112643911541_orig.jpg</a> is rotated properly by imagecreatefromjpeg (exif tag is honored) but not in Picasa or Win10 Photo viewer.</p>
  
  <p>There is no rotation in my code, when I say "is rotated properly by imagecreatefromjpeg" I mean it, literary. Simply by doing</p>
  
  <pre><code>$img = imagecreatefromjpeg($filename);
  </code></pre>
  
  <p>image is loaded from file and rotated properly. I'm running PHP 5.5.31-2+deb.sury.org~trusty+1 with GD version 2.1.1-dev.</p>
  
  <p>Image #2 <a href="https://dl.dropboxusercontent.com/u/9271284/stackoverflow/20160125070736520868_orig.jpg" rel="nofollow">https://dl.dropboxusercontent.com/u/9271284/stackoverflow/20160125070736520868_orig.jpg</a> is not rotated properly by imagecreatefromjpeg (exif tag is not honored) but is rotated properly in Picasa and Win10 Photo viewer.</p>
  
  <p>Also, using excellent Jeffrey's Exif Viewer <a href="http://regex.info/exif.cgi" rel="nofollow">http://regex.info/exif.cgi</a> results are consistent with what I'm seeing from imagecreatefromjpeg.</p>