Bug 115782 - Writer uses the different rotation orientation for Draw format images and Writer images
Summary: Writer uses the different rotation orientation for Draw format images and Wri...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: high normal
Assignee: Armin Le Grand (CIB)
URL:
Whiteboard: target:6.1.0 target:6.0.2
Keywords:
Depends on:
Blocks: Object-Rotation
  Show dependency treegraph
 
Reported: 2018-02-16 14:12 UTC by Regina Henschel
Modified: 2018-02-22 11:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Same UI results by different rotation angles (15.56 KB, application/vnd.oasis.opendocument.text)
2018-02-16 14:12 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2018-02-16 14:12:34 UTC
Created attachment 139948 [details]
Same UI results by different rotation angles

Open attached document. It contains an image as "Draw image", which means it is a "graphic" in LO, and the same image as "Writer image", which means it is a "frame" in LO.

The image have got an rotation of 30° in the UI and both images look the same on screen.

Unpack the file and look at the draw:transform attribute. One image has got a rotate(alpha) and the other rotate(-alpha). But the rotation has to be the same, because the file format makes no difference between a "Draw image" and a "Writer image", but both are draw:frame elements with the same graphic properties.

For the new Writer image rotation the sign has to be changes in writing to file and reading from file.

If you open the file in "Calligra Words" or in "Text Maker" you see, that the Writer image looks different there, because the rotation angle has the wrong sign.

You can not control it in MS Word, because MS Word has a bug, that it handles rotation angles wrongly, so that (rotate(-pi/6) and rotate((-pi/6)+2pi) is different for Word.

I set this to high priority, because it is a new feature and the correction should be done quickly, so that only few documents are affected.
Comment 1 Armin Le Grand (CIB) 2018-02-20 14:16:39 UTC
Discussed with Regina, thnks for the comments. Problem is that in ODF all angles are defined wrong orientated. For WriterFlyFrames I did it correct (to be safe for the future and later corrections for the other places). But it will be better to do the same as currently done in ODF anywhere, so will need to change to also do it 'wrong' using the wrong orientation.
Potential problem is that transform statements will be not self-containing: The form using the matrix directly by representing the matrix values will have to have the correct orientaiton when rotation is included, while a rotate(xyz) as a partial statement will have to use the 'wrong' orientation. Thus - when not knowing this fact - conversion in ODF from one form to the other will be very dangerous -> main reason to correct this in one of the coming ODF versions.

Note: Linear composition with 'wrong' orientation *will not* work correctly - that is how I found out about that error myself in the past ;-(
Comment 2 Armin Le Grand (CIB) 2018-02-20 14:58:35 UTC
Added, checked (interactively), version on gerrit.
Comment 3 Commit Notification 2018-02-21 01:10:15 UTC
Armin Le Grand committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea360461746f37be021b63da7a64a60d0f3c4af4

tdf#115782: Need to use mirrored rotation in ODF

It will be available in 6.1.0.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2018-02-21 09:26:56 UTC
Armin Le Grand committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=91374342ba491234a46aeb4b554b5e379869f301&h=libreoffice-6-0

tdf#115782: Need to use mirrored rotation in ODF

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Armin Le Grand (CIB) 2018-02-21 14:20:06 UTC
Okay, done:

tdf#115782: Need to use mirrored rotation in ODF (ea360461746f37be021b63da7a64a60d0f3c4af4)

in libreoffice-6-0: 91374342ba491234a46aeb4b554b5e379869f301