Description: LO seems to fail to properly apply affine transformation matrices with non-zero m12/m21 components (rotation or shearing the shapes). For the simple case with rotated rectangle LO seems to apply transformations to top-left and bottom-right corners than draw rectangle with an updated bbox. Steps to Reproduce: Load attached EMF sample in LO. Actual Results: EMF file is not rendered properly Expected Results: Proper support of EMF_SETWORLDTRANSFORM and EMF_MODIFYWORLDTRANSFORM Reproducible: Always User Profile Reset: No Additional Info: More samples are available by request
Created attachment 171512 [details] EMF sample with rotated rectangle
Created attachment 171513 [details] Screeenshot of the attached EMF with rotated rectangle sample opened in LO Draw
Created attachment 171514 [details] Screenshot for the file opened in MSO
Created attachment 171515 [details] EMF sample with rotated Ellipse
Created attachment 171516 [details] Screenshot for the file w rotated Ellipse opened in MSO
Reproduced in Version: 7.2.0.0.alpha0+ / LibreOffice Community Build ID: 78ad3fe28321a9e2e4eaa0dcc8f1ccdaed0b1f79 CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Also reproducible in Version: 5.4.0.0.alpha1+ Build ID: 9feb7f7039a3b59974cbf266922177e961a52dd1 CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3; Locale: en-US (en_US.UTF-8); Calc: group Version: 5.2.0.0.alpha0+ Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53 Threads 4; Ver: 5.7; Render: default; and Version: 4.3.0.0.alpha1+ Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e but not in Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Regression introduced by: https://cgit.freedesktop.org/libreoffice/core/commit/?id=1281c1f52b77c4c4fb08e129542c2c4912b38555 author Armin Le Grand <alg@apache.org> 2012-12-10 16:08:58 +0000 committer Caolán McNamara <caolanm@redhat.com> 2013-06-08 19:27:03 +0100 commit 1281c1f52b77c4c4fb08e129542c2c4912b38555 (patch) tree 9d359640355484084a985b738d27a3df93eee74d parent ec2512209d8fbf640749ab9f18b2232ac9cbf060 (diff) Resolves: #i121382# Corrected size handling including font size handling... for EMF/WMF imports Bisected with: bibisect-42max @Bartosz, I thought you might be interested in this issue...
@Xisco Are you sure the regression was introduced by this commit? Could you please attach screenshots of EMF files imported by LibreOffice 4.1?
Created attachment 171537 [details] How it looks before the mentioned commit
(In reply to Bartosz from comment #9) > @Xisco Are you sure the regression was introduced by this commit? > > Could you please attach screenshots of EMF files imported by LibreOffice 4.1? In fact, this change --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -639,8 +639,8 @@ namespace emfio double fWidth, fHeight; if (bDoWorldTransform) { - fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21; - fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22; + fWidth = rSz.Width() * maXForm.eM11; + fHeight = rSz.Width() * maXForm.eM12; } makes it to be displayed as a square again
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/24e71494d7d1a68b2cb5f5d34083ab02009e0982 tdf#55058 tdf#141982 EMF: Add rotation and path support for RECTANGLE record It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 171645 [details] EMF sample with rotated Chord
Comment on attachment 171645 [details] EMF sample with rotated Chord LO shows no image
Created attachment 171646 [details] EMF sample with rotated RounRect The shape is smashed the same way it was for rect before Bartosz' fix
Created attachment 171647 [details] Screenshot of the sample files (chord and roundrect) in MSO for mac MSO for win seems to have a bug: roundrect is not rotated. Wordpad shows the same as MSO on mac (+terrible rasterization)
Created attachment 171654 [details] EMF sample with rotated Pie LO shows nothing, the shape is very similar to Chord, a bit different rotation angle as per Bartosz request.
Created attachment 171655 [details] Screenshot of the sample file in MSO for win MSO on mac and wordpad failed to do it right
Created attachment 171661 [details] EMF sample with rotated Polyline LO shows empty object
Created attachment 171662 [details] Screenshot for polyline sample On the left how it looks in MSO on win. On the right -- how it should look like according to the spec.
Created attachment 171663 [details] EMF sample with rotated Polygon (good in LO 7.x) Attaching for completeness. This one is rendered properly.
Created attachment 171664 [details] Screenshot of the sample file with polygon in MSO for win
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/d08f1242ab3775c5f22d5624b91572c54d3fec81 tdf#55058 tdf#141982 EMF: Add rotation and path support for RECTANGLE record It will be available in 7.1.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi Bartosz, looking at https://cgit.freedesktop.org/libreoffice/core/commit/?id=24e71494d7d1a68b2cb5f5d34083ab02009e0982, you implemented the rotation for EMR_RECTANGLE. is it possible to do it for all the shapes at once or do we need to implement it for every case ?
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/761fdaf26dc9ed7cd0d25a7630576e7800813e2f tdf#142004 tdf#141982 EMF Import: Add rotation and path support for EMR_ELLIPSE It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Xisco Faulí from comment #24) > looking at > https://cgit.freedesktop.org/libreoffice/core/commit/ > ?id=24e71494d7d1a68b2cb5f5d34083ab02009e0982, you implemented the rotation > for EMR_RECTANGLE. is it possible to do it for all the shapes at once or do > we need to implement it for every case ? I would like to avoid regression which could appear during implementation. That's why I would like to cover every shape with separate test case. It will simplify tracking regression in future. I could try to implement all shapes in one go.
Hello Valek. Unfortunately Pie and Polyline is not displayed correctly under MS Paint (it seems that it is too small to be correctly displayed). Please provide Pie and Polyline which are displayed correctly under MS Paint. Summary what I need: - rotated POLYLINE (it could be also reflected like: https://en.wikipedia.org/wiki/Transformation_matrix#/media/File:2D_affine_transformation_matrix.svg) - rotated PIE (it could be different angle like 400 degrees) - sheared/rotated PIETO with additional LINETO (to check if it is drawing correctly)
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/eb1ec67f9a479148044f3869afe461e0f4533f22 tdf#142004 tdf#141982 EMF Import: Add rotation and path support for EMR_ELLIPSE It will be available in 7.1.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 171707 [details] EMF sample with rotated Pie (large)
Created attachment 171708 [details] Screenshot of the sample file (Pie enlarged) in MS Paint MS Word for win doesn't rotate Pie, wordpad does
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6bf2239a189423d087b2536dd7054b21df58ddc4 tdf#55058 tdf#141982 EMF: Add rotation support for ARC, ARCTO, CHORD, PIE It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 171709 [details] EMF sample with rotated Polyline (enlarged) MS Word on win fails to rotate it
Created attachment 171710 [details] Screenshot of the sample file (polyline enlarged) in MS Paint
Created attachment 171711 [details] EMF sample with rotated Ellipse (filled) As per Bartosz request
Created attachment 171712 [details] Screenshot of the sample file (ellipse filled) in MS Paint
Created attachment 171713 [details] EMF sample with xskewed pentagon
Created attachment 171714 [details] Screenshot of the sample file (xskewed pentagon) in MS Paint
Comment on attachment 171713 [details] EMF sample with xskewed pentagon Opens properly in LO 7.0.5, added for test coverage completeness
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/6eac9d960f2bb5dae54ef6ca8e7c659e8c79d011 tdf#55058 tdf#141982 EMF: Add rotation support for ARC, ARCTO, CHORD, PIE It will be available in 7.1.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 171715 [details] EMF sample with rotated LineTo-ArcTo-LineTo Doesn't render properly with LO 7.0.5
Created attachment 171716 [details] Screenshot of the sample file (LineTo-ArcTo-LineTo) in MS Paint
Created attachment 171753 [details] WMF sample intersectclip+excludeclip+ellipse As per Bartosz request
Created attachment 171754 [details] Screenshot of the WMF sample with intersect+excludeclip+ellipse opened in MS Paint
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1ef26ffe39618a745d3367310565e7eeb184a4c2 tdf#55058 tdf#141982 EMF: Add rotation support for INTERSECTCLIPRECT record It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
https://bugs.documentfoundation.org/attachment.cgi?id=171767 Sample for XForm appplied to ExcludeClipRect. (Added to 142037, which is about adding ExcludeClipRect)
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/a67a30227ef32ab9fc3026bb19e48d4447df25d1 tdf#55058 tdf#141982 EMF: Add rotation support for INTERSECTCLIPRECT record It will be available in 7.1.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 142206 has been marked as a duplicate of this bug. ***
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f11ed681df15728abe6a0b6b7b1612f190aa1707 tdf#141982 tdf#142139 Add rotation and line width support to ROUNDRECT It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/2a416c0c4a1635af8be5b1167fd1f06bdc4a2466 tdf#141982 tdf#142139 Add rotation and line width support to ROUNDRECT It will be available in 7.1.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hello Valek, Could you please confirm the issue is fixed in a master build? If you find any of the attached documents is still problematic, please create a follow-up ticket
(In reply to Xisco Faulí from comment #50) > Hello Valek, > Could you please confirm the issue is fixed in a master build? If you find > any of the attached documents is still problematic, please create a > follow-up ticket All but line-arc-line works fine. The problem with line-arc-line seems to be unrelated to XForm and looks more like 'behavior for undocumented situation'. I will investigate that and follow-up with Bartosz in a separate ticket.