I'm creating a thumbnail (compressed version of actual image) but for some images, it changes the image orientation. I'm saving both the images actual and thumbnail in my db. When I see the actual image it's fine but thumbnail is rotated. Is there any function/library/method to resolve this issue? here is my code:
private byte[] ResizeImage(byte[] bytes, ImageFormat format)
{
MemoryStream ms = new MemoryStream(bytes);
Image imageFull = Image.FromStream(ms);
Image imageResize = imageFull.GetThumbnailImage(_width, _height, null, IntPtr.Zero);
MemoryStream result = new MemoryStream();
imageResize.Save(result, format);
return result.ToArray();
}