-1

I have an upload form which works fine for uploading an image. I was not able to see the image in correct rotation. Here is the example in which I wrote a css to show you the correct rotation:

 <style>
    .as {
       transform: rotate(90deg);
      -ms-transform: rotate(90deg); /* IE 9 */
      -moz-transform: rotate(90deg); /* Firefox */
      -webkit-transform: rotate(90deg); /* Safari and Chrome */
      -o-transform: rotate(90deg); /* Opera */
    }
  </style>


<!-- orignal image -->
<img src="http://www.thediscerningbrute.com/wp-content/uploads/2010/06/Men__3_flat.jpg">

    <!-- orignal image -->
    <!-- i am getting image like this -->    
<img src="http://www.thediscerningbrute.com/wp-content/uploads/2010/06/Men__3_flat.jpg" class="as">
    <!-- i am getting image like this -->    
Mehraban
  • 3,164
  • 4
  • 37
  • 60
user4557928
  • 31
  • 1
  • 2

2 Answers2

0

Might be due to EXIF Some image files contain EXIF information inside like rotation, datetime, location etc Your PHP code might be discarding the EXIF when saving it

Glass Cannon
  • 394
  • 3
  • 9
0

Use this library Library

If you include the Load Image Exif Parser extension, the parseMetaData callback data contains the additional property exif if Exif data could be found in the given image. The exif object stores the parsed Exif tags:

var orientation = data.exif[0x0112];

It also provides an exif.get() method to retrieve the tag value via the tag's mapped name:

var orientation = data.exif.get('Orientation');
Prashant Tapase
  • 2,132
  • 2
  • 25
  • 34