I downloaded the ImageProcessor library using nuget for c#. I am using it to upload and resize image for a website. The upload process works fine except, when I try to view the uploaded image it appears backward rotated 90 from the original image. Here is the code that I am using:
ISupportedImageFormat format = new JpegFormat { Quality = 70 };
using (MemoryStream inStream = new MemoryStream(_img))
{
using (MemoryStream outStream = new MemoryStream())
{
// Initialize the ImageFactory using the overload to preserve EXIF metadata.
using (ImageFactory imageFactory = new ImageFactory(preserveExifData: false))
{
// Load, resize, set the format and quality and save an image.
imageFactory.Load(inStream)
.Resize(new ResizeLayer(new Size(width, height), resizeMode: resizeMode))
.Format(format)
.Save(outStream);
}
return outStream.ToArray();
}
}