Description: Importing svg images/plots exported from R using ggsave/svglite is broken. Most of the components of the plots are not shown. Opening the same plot in Inkscape everything is displayed correctly so it is a valid svg file. A fix I have found is to run the bellow on the SVG, then everything is displayed correctly. sed 's/^.g\s[^<]*//g;s/<\/g>$//g' my_svg_file.svg > my_fixed_svg_file.svg which will for example change the bellow: <g clip-path='url(#cpMTA1LjA2fDM5OC42OXwxMDguMzh8Mzk0Ljg3)'> <rect x='105.06' y='108.38' width='293.62' height='286.50' style='stroke-width: 1.36; stroke: #FFFFFF; fill: #FFFFFF;' /> </g> to: <rect x='105.06' y='108.38' width='293.62' height='286.50' style='stroke-width: 1.36; stroke: #FFFFFF; fill: #FFFFFF;' /> The above, after the fix will display correctly in Impress. Why can't Impress display the plot correctly when there is the <g> tag? Steps to Reproduce: Import an svg with using the g tag Actual Results: Most graphics will not display Expected Results: Everything from the svg should display like they do in Inkscape Reproducible: Always User Profile Reset: No Additional Info: [Information automatically included from LibreOffice] Locale: en-US Module: PresentationDocument [Information guessed from browser] OS: Linux (All) OS is 64bit: yes
Created attachment 193311 [details] Image showing the same svg imported before and after fixing
Created attachment 193312 [details] Same svg plot opened in inkscape without the need to fix it first
Created attachment 193313 [details] svg file to test for importing in impress
Regression introduced by: author Xisco Fauli <xiscofauli@libreoffice.org> 2023-08-22 12:46:02 +0200 committer Xisco Fauli <xiscofauli@libreoffice.org> 2023-08-22 20:06:24 +0200 commit b2247336409b7b3b0ae04356a167dcd204badb04 (patch) tree ebe8292d5a928d771b31ba13bb54d90cc3b2f96f parent 3cf3e0e21d2f7fa33abced5e2f7291de6e4441eb (diff) tdf#129356: handle css combinator when the element name is combined... Bisected with: bibisect-linux64-24.2
reproduced on Windows 11: Version: 24.2.1.2 (X86_64) / LibreOffice Community Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
Created attachment 193318 [details] minimal example
With the minimal example, if the fill:none is replaced with something else, i.e. fill:black, then the blue rect is displayed. weird...
for the record, this is not a regression as my minimal example shows. b2247336409b7b3b0ae04356a167dcd204badb04 just exposed a previous issue and made it more visible
Indeed, it's not needed to remove the whole g tags. It seems just removing the clip-path within the <g> tags is enough for svg import to work. If doing for example the bellow sed on the provided test.svg file then the resulting test_fix_clip.svg file imports OK to impress. sed "s/\sclip-path=.*'//g" test.svg > test_fix_clip.svg
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/feb4e0890b883940ec6964375293727ac6229f1c tdf#160373: Iterate over all parents to check whether it's a clipPath content 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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/ea3d61886a2b420b985bed162c28b94698283c76 tdf#160373: Iterate over all parents to check whether it's a clipPath content It will be available in 24.2.3. 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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/d6d502f41346b021d369c27c9ed969d75d680986 tdf#160373: Iterate over all parents to check whether it's a clipPath content It will be available in 7.6.7. 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.
Checked the daily build 24.2.4 and it now works importing SVGs. I opened the same odp document which contains the same SVG before and after fixing and now the SVG before applying the fix is correctly displayed.
Created attachment 193642 [details] Image showing the same odp opened in the 7.6.5.2 and the 24.2.4 impress.
(In reply to d_tassos from comment #13) > Checked the daily build 24.2.4 and it now works importing SVGs. Thanks for testing. Let's mark as "verified" then.