Created attachment 139677 [details]
Dummytext with rotated image
The attached document was generated by Word from Office365. Opening in LO6.1 the rotation and the position is totally wrong.
The image has size 9cm width and 4cm height. It is anchored to paragraph with "parallel"-wrap. Its position is 4cm from left and 3cm from top relative to paragraph. So the center of the image is at 8,5cm from left and 5cm from top. The image is rotated by 30deg. The rotated image should have the same center.
If you unpack the file and look, what Word has written, you find, that the values are correct. So it is an import failure of LibreOffice.
I have tried it with Version: 220.127.116.11.alpha0+ (x64)
Build ID: 715114595e0feec49c4d54cc5eb26f13dccb7968
CPU threads: 8; OS: Windows 10.0; UI render: default;
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-02-06_02:09:50
Locale: de-DE (de_DE); Calc: CL
Created attachment 139678 [details]
Spreadsheet for manually calculating the rotation
The spreadsheet protection is without password. You can use the spreadsheet to calculate the transformation, which is given in the file, manually step-by-step . The default value for missing svg:x and svg:y values is zero.
Created attachment 139695 [details]
Example to test angles
Similar problem can be seen in LibreOffice itself. Open attached document and set the rotation angle of the image to some values. Especially try 179°, 181°, 359°. Save the document and load it. Notice that the angles in the range 181° to 359° are broken in reload. Look at sidebar and in the image properties too.
Position is a different problem. I have written bug 115590 for it. So the first attachment belongs to bug 115590.
In the meantime I have calculated Words values manually and found, that Word writes the sign of the rotation angle wrong. So use the "Dummytext with rotated image"-file for confirming this issue as described in comment 2.
Will ahve to take a look ASAP...
Debugging case, seems to have to do with numerical stuff only. Diverse places where warnings/corrections may/should be applied...
Probably found, trying modification.
Patch on gerrit (https://gerrit.libreoffice.org/#/c/49826/)
Checked locally, patch is on master.
Checking how to evtl. get to LO-6-0
The commit message has a wrong bug number. It is tdf#115519 but should be tdf#115529.
The comments in grfatr.cxx and grfatr.hxx in the patch have wrong bug number. It is tdf#15529 but should be tdf#115529.
Armin Le Grand committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":
tdf#115529: Handle rotation for WriterFlyFrames correctly
It will be available in 6.0.2.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
I corrected the bug numbers in commit dad787ca46457c77c1ac67d62a9a370ea3fbd8ee (master)