-1

I am using ASP.Net with VB and doing some file uploads. Sometimes, when a bitmap is constructed from the file input stream, the image gets rotated. It doesn't seem to happen if the image is wider than it is tall, but also doesn't seem to happen all the time if the image is taller than wide. I have provided a few screen shots where the properties of the image are show, and the created bitmap's properties are shown at run time.

Any ideas what is happening here or what we can do to prevent this rotation?

Rotated image: enter image description here

Non-rotated image: enter image description here

Dan Wier
  • 334
  • 5
  • 16
  • 1
    I can hardly belive that saving to an reading from streams alone would rotate images. There must be an image format incompatibility or other logic involved here doing its work. – Olivier Jacot-Descombes Nov 04 '17 at 18:06
  • Can you check if the image orientation is present as an EXIF tag (see [this question](https://stackoverflow.com/questions/42971094/getting-correct-image-rotation))? – Nico Schertler Nov 04 '17 at 19:14
  • Checking the image orientation fixed it. That is something I had never seen before. – Dan Wier Nov 04 '17 at 23:50

1 Answers1

2

Using the rotation code found Here fixed it. The images were coming from a phone camera and had original orientation information stored in them that could be used to right them.

Dan Wier
  • 334
  • 5
  • 16