Bug 158445 - SVG file not imported correctly
Summary: SVG file not imported correctly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1 all versions
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:24.8.0 target:24.2.1 target:7.6.5
Keywords:
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2023-11-29 19:35 UTC by Rafael Lima
Modified: 2024-02-29 17:22 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
SVG file (6.15 KB, image/svg+xml)
2023-11-29 19:35 UTC, Rafael Lima
Details
SVG file in Inkscape vs LO Draw (157.72 KB, image/png)
2023-11-29 19:38 UTC, Rafael Lima
Details
minimized reproducer (deleted)
2023-11-29 19:49 UTC, Xisco Faulí
Details
minimized reproducer (1.20 KB, image/svg+xml)
2023-11-29 20:04 UTC, Xisco Faulí
Details
tdf#158445 Arrow.svg (1.94 KB, image/svg+xml)
2024-02-29 16:56 UTC, Piotr Osada
Details
tdf#158445 Arrow.svg - Inkscape.png (119.22 KB, image/png)
2024-02-29 16:57 UTC, Piotr Osada
Details
tdf#158445 SVG arrow LO24.2.1.2.odt (21.62 KB, application/vnd.oasis.opendocument.text)
2024-02-29 16:57 UTC, Piotr Osada
Details
tdf#158445 SVG Arrow in LO24.2.1.2.png (21.33 KB, image/png)
2024-02-29 16:58 UTC, Piotr Osada
Details
tdf#158445 SVG arrow MSO Word 365 2401.docx (39.26 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-02-29 16:58 UTC, Piotr Osada
Details
tdf#158445 SVG arrow MSO Word 365 2401.png (16.49 KB, image/png)
2024-02-29 16:58 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-11-29 19:35:25 UTC
Created attachment 191120 [details]
SVG file

The attached SVG file is not correctly imported in any of LO applications (Writer, Draw, Impress). It contains an equation rendered as SVG by ziamath (used to convert MathML and Latex to SVG).

In Firefox, MS Edge and Inkscape the SVG file opens fine.

System info:

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.3~rc2-0ubuntu0.23.10.1~lo2
Calc: threaded

Also present in

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8369765ec5be151082a6e31c16e2ab2b0df13f5c
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Rafael Lima 2023-11-29 19:38:01 UTC
Created attachment 191121 [details]
SVG file in Inkscape vs LO Draw

In this screenshot I opened the SVG file in Inkscape (top) and LO Draw (bottom).
Comment 2 Xisco Faulí 2023-11-29 19:44:06 UTC
Also reproduced in

Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: 229123ccc6f90ebf66b3e659bebbd53f8a9bdd3a
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2023-11-29 19:48:03 UTC
and in

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: x11; 
Locale: es-ES (es_ES.UTF-8); Calc: group threaded
Comment 4 Xisco Faulí 2023-11-29 19:49:37 UTC
Created attachment 191122 [details]
minimized reproducer
Comment 5 Xisco Faulí 2023-11-29 19:59:59 UTC
(In reply to Xisco Faulí from comment #4)
> Created attachment 191122 [details]
> minimized reproducer

sorry, my bad. wrong file
Comment 6 Xisco Faulí 2023-11-29 20:00:11 UTC
The content of attachment 191122 [details] has been deleted for the following reason:

wrong file
Comment 7 Xisco Faulí 2023-11-29 20:04:21 UTC
Created attachment 191123 [details]
minimized reproducer
Comment 8 Xisco Faulí 2023-11-29 20:11:18 UTC
LoL, the symbol node reads the viewbox but does nothing with it-> https://opengrok.libreoffice.org/xref/core/svgio/source/svgreader/svgsymbolnode.cxx?r=48ff87e1#57
Comment 9 Xisco Faulí 2024-01-26 10:42:59 UTC
In my case, Inkscape 1.2.2 displays the document the same way a LibreOffice.
@Rafael, could you please tell which version of Inkscape are you using ?
Comment 10 Xisco Faulí 2024-01-26 10:50:48 UTC
(In reply to Xisco Faulí from comment #9)
> In my case, Inkscape 1.2.2 displays the document the same way a LibreOffice.
> @Rafael, could you please tell which version of Inkscape are you using ?

in Inkscape it's displayed correctly.
Comment 11 Xisco Faulí 2024-01-26 10:51:17 UTC
(In reply to Xisco Faulí from comment #10)
> (In reply to Xisco Faulí from comment #9)
> > In my case, Inkscape 1.2.2 displays the document the same way a LibreOffice.
> > @Rafael, could you please tell which version of Inkscape are you using ?
> 
> in Inkscape it's displayed correctly.

Inkscape 1.3.2 I mean
Comment 12 Xisco Faulí 2024-01-26 11:11:30 UTC
my theory is that svg 2 instroduced something which is LibreOffice isn't supporting at the moment
Comment 13 Xisco Faulí 2024-01-26 11:32:32 UTC
(In reply to Xisco Faulí from comment #12)
> my theory is that svg 2 instroduced something which is LibreOffice isn't
> supporting at the moment

no, I was wrong, if the path is outside the symbol element, then it's rendered correctly. So the path inside symbol is the problem
Comment 14 Rafael Lima 2024-01-26 13:41:29 UTC
(In reply to Xisco Faulí from comment #9)
> In my case, Inkscape 1.2.2 displays the document the same way a LibreOffice.
> @Rafael, could you please tell which version of Inkscape are you using ?

I'm on Inkscape 1.3.2... i had not tested with 1.2.2
Comment 15 Commit Notification 2024-01-26 18:31:43 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e7186b49a9a0b24ddc3b1c5384b5d9facb03518c

tdf#158445: support viewBox in symbol elements

It will be available in 24.8.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.
Comment 16 Rafael Lima 2024-01-28 23:10:02 UTC
@Xsico, thanks for the fix. I can verify that the SVG file is now correctly imported.

Verified with

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3be785e088cc0aa726509cf6b52b1d3b03817172
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded
Comment 17 Commit Notification 2024-01-30 13:38:00 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/38dd3c75d40bd5ebbc63b192e38d581bed9b9092

tdf#158445: support viewBox in symbol elements

It will be available in 24.2.1.

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.
Comment 18 Commit Notification 2024-01-31 13:07:03 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/f0c090973572ba87206361a3d88055b7e0961ff1

tdf#158445: support viewBox in symbol elements

It will be available in 7.6.5.

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.
Comment 19 Piotr Osada 2024-02-29 16:56:24 UTC
Created attachment 192867 [details]
tdf#158445 Arrow.svg

There are still some problems with displaying SVG content. The arrow from the attached SVG file is rendered as a square overlying the end of the line.

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded
Comment 20 Piotr Osada 2024-02-29 16:57:19 UTC
Created attachment 192868 [details]
tdf#158445 Arrow.svg - Inkscape.png
Comment 21 Piotr Osada 2024-02-29 16:57:47 UTC
Created attachment 192869 [details]
tdf#158445 SVG arrow LO24.2.1.2.odt
Comment 22 Piotr Osada 2024-02-29 16:58:06 UTC
Created attachment 192870 [details]
tdf#158445 SVG Arrow in LO24.2.1.2.png
Comment 23 Piotr Osada 2024-02-29 16:58:21 UTC
Created attachment 192871 [details]
tdf#158445 SVG arrow MSO Word 365 2401.docx
Comment 24 Piotr Osada 2024-02-29 16:58:34 UTC
Created attachment 192872 [details]
tdf#158445 SVG arrow MSO Word 365 2401.png
Comment 25 Xisco Faulí 2024-02-29 17:00:24 UTC
Hi Piotr Osada,
please create a new report for the arrow issue
Comment 26 Piotr Osada 2024-02-29 17:22:09 UTC
(In reply to Xisco Faulí from comment #25)
> Hi Piotr Osada,
> please create a new report for the arrow issue

All right. Reported in: Bug 159968.