Bug 115590 - Image position is wrong, if svg:x and svg:y does not exist
Summary: Image position is wrong, if svg:x and svg:y does not exist
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2018-02-09 17:00 UTC by Regina Henschel
Modified: 2022-12-17 13:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Anchor to page, from left and from top relative to page, version without svg:x and svg:y (10.43 KB, application/vnd.oasis.opendocument.text)
2018-02-09 17:00 UTC, Regina Henschel
Details
Anchor to page, from left and from top relative to page text area, version without svg:x and svg:y (10.44 KB, application/vnd.oasis.opendocument.text)
2018-02-09 17:02 UTC, Regina Henschel
Details
Anchor to page, from left and from top relative to page text area, svg:x and svg:y as saved as default (11.68 KB, application/vnd.oasis.opendocument.text)
2018-02-09 17:03 UTC, Regina Henschel
Details
Anchor to page, from left and from top relative to page, svg:x and svg:y as saved as default (11.67 KB, application/vnd.oasis.opendocument.text)
2018-02-09 17:04 UTC, Regina Henschel
Details
Formula with draw:transform attribute (10.74 KB, application/vnd.oasis.opendocument.text)
2018-02-10 15:59 UTC, Regina Henschel
Details
image with draw:transform attribute (10.08 KB, application/vnd.oasis.opendocument.text)
2018-02-10 16:07 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-09 17:00:44 UTC
Created attachment 139738 [details]
Anchor to page, from left and from top relative to page, version without svg:x and svg:y

If Word rotates an image, then it writes it to an odt file in a way, that svg:x and svg:y is missing. The translation before rotation and the translation after rotation are different then.

LibreOffice gets the position of the rotated images wrong in these cases. Word uses the rotation angle with wrong sign, but that does not influence the position.

If you open the files with "_no_XY" and "_withXY" in Word, you can see that the position of the rotated image (width=2cm height=6cm) is the same. If you open the files in LibreOffice, you see, that the position of the rotated image in the "_no_XY" files is wrong.

If svg:x or svg:y is not given, then it defaults to zero.

For a file produced be Word see attachment https://bugs.documentfoundation.org/attachment.cgi?id=139695 from bug 115529.
In the files attached here, I have changed position and transformation manually.
Comment 1 Regina Henschel 2018-02-09 17:02:38 UTC
Created attachment 139739 [details]
Anchor to page, from left and from top relative to page text area, version without svg:x and svg:y
Comment 2 Regina Henschel 2018-02-09 17:03:51 UTC
Created attachment 139740 [details]
Anchor to page, from left and from top relative to page text area, svg:x and svg:y as saved as default
Comment 3 Regina Henschel 2018-02-09 17:04:40 UTC
Created attachment 139741 [details]
Anchor to page, from left and from top relative to page, svg:x and svg:y as saved as default
Comment 4 Regina Henschel 2018-02-10 15:59:56 UTC
Created attachment 139759 [details]
Formula with draw:transform attribute
Comment 5 Regina Henschel 2018-02-10 16:07:24 UTC
Created attachment 139760 [details]
image with draw:transform attribute

The problem exists independent from rotating. The draw:transform="translate(-2cm -1cm)" attribute in the last two examples is not evaluated. The objects have svg:x="5cm" and svg:y="3cm". Because of the translation the top-left corner should be at position (3cm|2cm).
Comment 6 Regina Henschel 2018-02-22 18:57:20 UTC
Proposed patch is in https://gerrit.libreoffice.org/#/c/50176/
Comment 7 Xisco Faulí 2018-02-23 12:40:54 UTC
Moving to ASSIGNED
Comment 8 Regina Henschel 2018-04-08 08:11:59 UTC
On Hackfest Hamburg, April 2018, we have decided to solve the problem in a way, which is more promising for the general goal to bring Writer frames and shapes together. The idea is, to bring the complete transformation matrix to the model and set needed properties using the matrix as authority information.

Therefore I have abandoned https://gerrit.libreoffice.org/#/c/50176/ for now and reset assignee of the bug back to default.

If you want to work an this bug, contact Armin (Armin.Le.Grand@me.com) in addition.
Comment 9 QA Administrators 2020-12-16 03:57:22 UTC Comment hidden (obsolete)
Comment 10 Regina Henschel 2020-12-16 12:21:11 UTC
The problem still exists in Version: 7.2.0.0.alpha0+ (x64)
Build ID: 4e63ec27b69fa01ff610c894c9fbf05c377a6179
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: default; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL

It is a problem with the special frame object handling in Writer. If you make the frame to a Draw object by removing the parent-style attribute, the position is correct.
The position is also correct in the thumbnail.
Comment 11 QA Administrators 2022-12-17 03:19:24 UTC Comment hidden (obsolete)
Comment 12 Regina Henschel 2022-12-17 13:16:58 UTC
The draw:transform attribute is still ignored in Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9b46020c262045aed0beace4708565235c2523cc
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL threaded