Insert Image with Exif Orientation in Word Document using C# .NET Core

The orientation of the inserted image is not as expected, example code & file.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertImage(@"C:\temp\1625269686733.jpg");
doc.Save(@"C:\temp\out.docx", SaveFormat.Docx);

1625269686733.jpg (6.0 KB)

If you insert the same image via word it will be the correct orientation.

@mlcs3,

After an initial test with the licensed latest (21.7) version of Aspose.Words for .NET, we were unable to reproduce this issue on our end. Please check below MS Word 2019 and Aspose.Words for .NET 21.7 generated Word DOCX documents:

So, we suggest you to please upgrade to the latest version of Aspose.Words for .NET.

Hi Awais,

I think your server might be re-orientating the image I upload here shows a smaller file size than what I actually uploaded.

Find attached the jpg as a zip, this is a standard photo from a Samsung Galaxy S10.

1625269686733.zip (5.9 MB)

I tried it with the latest nuget package 21.7.0

Thanks

@mlcs3,

Thanks for the additional information. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22466. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-22466) have been fixed in this Aspose.Words for .NET 21.9 update.