We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

jpg image orientation while mailmerging

hello,
I try to import jpg image files with docio mailmerging in a word document. it seems that EXIF jpg orientation is not kept when importing the jpg data into the resulting word file.
Do you intend intend to deal with that in next version?
What can I do to obtain the right orientation (performing rotation before mailmerging? how to know the jpg file orientation) ?
Regards,
Thibault

8 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team November 8, 2018 10:50 AM UTC

Hi Thibault, 

Thank you for contacting Syncfusion support. 

We have tried to reproduce the reported image rotation problem when executing mail merge with the rotated image in DocIO, but it preserves properly with the actual rotation. For your reference, we have prepared a sample application to execute mail merge with the rotated JPG image and it can be download from the below link: 

We suspect that the problem might be due to image and the input Word document used at your end. So, could you please provide us the following things from your end: 
1. Modified sample of above along with input Word document and images used at your end. 
2. Expected output document. 
This will be more helpful to check on the reported problem and then we will provide you the appropriate solution at the earliest. 

Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face. 

Please let us know if you have any other questions. 

Regards, 
Dilli babu. 



TH Thibault November 12, 2018 08:26 AM UTC

Helolo,

I replaced in your sample the jpg file with mine, and see the result: the picture orientation is wrong.

regards,

Thibault BEGIN

Attachment: rotated_jpg_94f0f597.zip


DB Dilli Babu Nandha Gopal Syncfusion Team November 12, 2018 12:36 PM UTC

Hi Thibault, 

On further analyzing with the given image, we have found that rotation is applied in the input image itself. Microsoft Word application considered this auto rotation value when inserting image in the Word document. We have found the solution to identify the rotation in the jpg image in .NET Framework platform. We have used the functionality from System.Drawing.Image to identify the rotation which is not available in UWP platform. Currently we are analyzing to identify the image rotation in UWP platform.

At the meantime, could you please provide your confirmation whether you need the solution in .NET Framework or UWP platform? This will be more helpful to provide the solution at the earliest. 

Regards, 
Dilli babu 



TH Thibault November 12, 2018 01:11 PM UTC

Hello
I need the solution for UWP platform and also for Xamarin Windows Forms (this last one in 2019).

Regards,
Thibault


TH Thibault November 12, 2018 01:15 PM UTC

COUld you provide a patch for 16.3.0.21?


DB Dilli Babu Nandha Gopal Syncfusion Team November 15, 2018 04:15 PM UTC

Hi Thibault, 

Thank you for your patience. 

We have prepared a sample based on your requirement which can be downloaded from the following link. 

In this sample, we have done the following things:
1. Loads a template Word document using DocIO. 
2. Executes mail merge in the document. 
3. While executing mail merge for the image field, gets the index of field and paragraph. 
4. Iterates to the resultant picture in the mail merged document. 
5. Rotate the picture. 
6. Saves the Word document. 

Please let us know if you have any questions. 

Regards, 
Dilli babu. 



TH Thibault September 26, 2019 12:34 PM UTC

Hello,
I was using this solution since you provided the sample.
Now i had to import in my application a 270° rotated jpg file and it seems that it does not work in case of 270° EXIF orientation  :
i had to replace the code

   "case PhotoOrientation.Rotate270:
                    picture.Rotation = 270;"

with
   "case PhotoOrientation.Rotate270:
                    picture.Rotation = 90;"

Why this behaviour?

Regards,
Thibault



SB Suriya Balamurugan Syncfusion Team September 27, 2019 01:08 PM UTC

Hi Thibault,

Thank you for your update.

We suspect that the problem might be due to the rotation defined in the image level (internally), which requires 90 degree rotation to fit properly in visual appearance. Could you please share us the image which used at your end. Thereby we will check in depth on your problem and provide you the appropriate solution at the earliest.

If you have any confidential information in your image, you can also mail the files to our Syncfusion support through support@syncfusion.com.

Please let us know if you have any other questions.

Regards,
Suriya Balamurugan.


Loader.
Live Chat Icon For mobile
Up arrow icon