0

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();
        }
Okasha Momin
  • 121
  • 2
  • 13
  • See [Some images are being rotated when resized](https://stackoverflow.com/questions/33310562/some-images-are-being-rotated-when-resized/33313625). – dr.null Nov 10 '21 at 12:04

0 Answers0