Bug 123926 - Clip-path elements of imported/inserted SVG images aren't displayed correctly
Summary: Clip-path elements of imported/inserted SVG images aren't displayed correctly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.2 all versions
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:6.4.0 target:6.3.4
Keywords: bibisected, bisected, filter:svg, regression
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2019-03-07 14:44 UTC by Federico Kereki
Modified: 2019-10-21 09:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
SVG file as produced by Highcharts at https://www.highcharts.com/demo/bubble (17.18 KB, image/svg+xml)
2019-03-07 14:46 UTC, Federico Kereki
Details
Screenshot showing the SVG file as rendered by Chrome (124.33 KB, image/png)
2019-03-07 14:47 UTC, Federico Kereki
Details
Screenshot showing the SVG file rendered incorrectly by CALC (150.12 KB, image/png)
2019-03-07 14:48 UTC, Federico Kereki
Details
Screenshot showing the SVG file rendered incorrectly by IMPRESS too (140.15 KB, image/png)
2019-03-07 14:52 UTC, Federico Kereki
Details
Screenshot showing the SVG file rendered incorrectly by WRITER too (95.58 KB, image/png)
2019-03-07 14:57 UTC, Federico Kereki
Details
minimal SVG file to reproduce the issue (1.03 KB, image/svg+xml)
2019-03-22 17:13 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Kereki 2019-03-07 14:44:28 UTC
Description:
If you export a Highcharts chart to SVG and import it (as an image) in Libreoffice Calc, the chart does not show correctly. The same exported file DOES appear correctly if opened with Chrome or Safari. The behavior has been verified in Linux and Mac OS X.


Steps to Reproduce:
1.Go to https://www.highcharts.com/demo/bubble
2.Click on the hamburger icon at the top right of the chart
3.Click on DOWNLOAD SVG VECTOR IMAGE
4.Save the file
5.Create a new spreadsheet with Calc
6.Insert the image


Actual Results:
The image won't show correctly; the bubbles themselves will not be shown. 
I have tested this in Linux and Mac OS X with the same results.

Expected Results:
The image should show correctly. 


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
If you open the same SVG file with Chrome or Safari, it works correctly.

The current version of LibreOffice is:

Version: 6.2.0.3
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU threads: 4; OS: Mac OS X 10.14.1; UI render: default; VCL: osx; 
Locale: en-US (en_UY.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Federico Kereki 2019-03-07 14:46:06 UTC
Created attachment 149796 [details]
SVG file as produced by Highcharts at https://www.highcharts.com/demo/bubble

To reproduce this file, go to https://www.highcharts.com/demo/bubble, click on the hamburger icon at the top right of the chart, and select the option to download as SVG.
Comment 2 Federico Kereki 2019-03-07 14:47:58 UTC
Created attachment 149797 [details]
Screenshot showing the SVG file as rendered by Chrome

If you open the SVG in Chrome, it is shown perfectly.
The same happens with Safari and Firefox.
Comment 3 Federico Kereki 2019-03-07 14:48:47 UTC
Created attachment 149798 [details]
Screenshot showing the SVG file rendered incorrectly by CALC
Comment 4 Federico Kereki 2019-03-07 14:52:17 UTC
Created attachment 149799 [details]
Screenshot showing the SVG file rendered incorrectly by IMPRESS too

The SVG image is also displayed wrongly in IMPRESS.
Comment 5 Federico Kereki 2019-03-07 14:57:13 UTC
Created attachment 149800 [details]
Screenshot showing the SVG file rendered incorrectly by WRITER too

The wrong behavior is common to WRITER too.
Comment 6 Telesto 2019-03-07 19:34:23 UTC
Repro with
Version: 6.3.0.0.alpha0+
Build ID: aa51774e6a309f277e71ca3a3b9d5d5b4b3dbf1a
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-02-18_06:06:03
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL

but not with
4.4.7.2
Comment 7 V Stuart Foote 2019-03-08 18:01:56 UTC
General fidelity of text spans look good, but seems to be an issue with svgio handling the clip-path stanzas for the bubbles.

@Telesto -- not a regression, as 4.4 was on the old SVG import filter which was fully killed off for the svgio implementation [1]. Dropping the bibisect and regression keywords.

=-ref-=
[1] https://gerrit.libreoffice.org/#/c/54096/
Comment 8 Federico Kereki 2019-03-09 13:21:50 UTC
Please, do note that there's some problem with the subtitle ("SOURCE EUROMONITOR AND OECD") too.
Comment 9 Xisco Faulí 2019-03-22 16:47:07 UTC
Regression introduced by:

author	Xisco Fauli <anistenis@gmail.com>	2016-03-28 19:24:29 +0200
committer	Xisco Faulí <anistenis@gmail.com>	2016-03-29 08:00:47 +0000
commit 3041df16f8315859ddf22075eac8f9ad4fa37b8e (patch)
tree f221fa0aea0f3abcf9e67b0b4e7e7fe0158321de
parent d5e4fe23b2af09a2989a0b1c37b13bb4b2ea8787 (diff)
SVGIO: Don't inherit style attributes from parent if the...
... shapes define their own attributes.

Bisected with: bibisect-linux-64-5.2

Adding Cc: to Xisco Fauli

Maybe I can take a look at it at some point...
Comment 10 Xisco Faulí 2019-03-22 16:48:50 UTC
(In reply to V Stuart Foote from comment #7)
> @Telesto -- not a regression, as 4.4 was on the old SVG import filter which
> was fully killed off for the svgio implementation [1]. Dropping the bibisect
> and regression keywords.

svgio can be used in old version with Insert - Image
Comment 11 Xisco Faulí 2019-03-22 17:13:40 UTC
Created attachment 150197 [details]
minimal SVG file to reproduce the issue
Comment 12 Xisco Faulí 2019-09-19 13:21:31 UTC
the problem is not with the clippath it seems, but with the fill="none".
Changing it to fill="black" fixes the issue...
Comment 13 Xisco Faulí 2019-09-19 13:44:27 UTC
I know how to fix this one...
Comment 14 Commit Notification 2019-09-19 19:58:01 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/586de7ac433dca98edf4a5a3d13b5e393b9880ed

tdf#123926: SVGIO: Check parent's fill when...

It will be available in 6.4.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 15 Commit Notification 2019-10-21 09:34:26 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/5b4b6d08d1a839a595f42a56ecff5d4964fcf90c

tdf#123926: SVGIO: Check parent's fill when...

It will be available in 6.3.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.