Bug 43257 - SVG: Colors missing in particular documents
Summary: SVG: Colors missing in particular documents
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: BSA target:5.1.0
Keywords:
Depends on:
Blocks: SVG-Open
  Show dependency treegraph
 
Reported: 2011-11-26 08:32 UTC by Rainer Bielefeld Retired
Modified: 2018-06-20 17:03 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
Reduced test file (2.10 KB, image/svg+xml)
2012-02-23 02:03 UTC, Christina Rossmanith
Details
test file displayed in LibreOffice (26.87 KB, image/png)
2012-02-23 02:05 UTC, Christina Rossmanith
Details
test file displayed in firefox (4.16 KB, image/png)
2012-02-23 02:05 UTC, Christina Rossmanith
Details
SVG missing color after opening (117.71 KB, image/png)
2014-08-29 15:42 UTC, Robinson Tryon (qubit)
Details
screenshot of Pict0.svg (193.88 KB, image/png)
2015-02-18 20:41 UTC, Yousuf Philips (jay) (retired)
Details
Screenshot of colored svg (219.01 KB, image/png)
2015-02-18 22:43 UTC, Dennis Roczek
Details
Screenshot of colored svg in Draw (190.53 KB, image/png)
2015-02-18 22:50 UTC, Dennis Roczek
Details
Draw screenshot under Win7Professional N SP1 64bit (125.27 KB, image/png)
2015-02-18 23:03 UTC, Dennis Roczek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2011-11-26 08:32:53 UTC
Steps to reproduce with "LibreOffice 3.4.4  - WIN7 Home Premium (64bit) German UI [OOO340m1 (Build:402)]" :
1. downolad sample documents from Bug 34721 - 
   MinGW FILEOPEN impossible for particular SVG
2. Start LibO
   /Start Center appears/
3. Menu 'File -> Open -> select "3425 (7).svg" -> <open>
   /Document will be opened in DRAW/
   Expected: looks perfect like in Browser
   Actual: missing color filling in small circles, so that 
           white characters seem invisible

My Seamonkey always repeats the number in the circle right from the circle, but that might be a problem with the browser, LibO shows a number shape as a (white) outline around the number character.
           

Current behavior:

Expected behavior:

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20111121 Firefox/8.0.1 SeaMonkey/2.5
Comment 1 Rainer Bielefeld Retired 2011-11-26 08:34:39 UTC
Currently only observed with WIN.

Still [Reproducible] with Server installation of MSVC Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) ENGLISH UI [(Build ID:  4f11d0a-adcf6d5-c4bb9bd)]" Windows_2008R8 - 111118)

- Reported with Bug Submission Assistant -
Comment 2 Christina Rossmanith 2012-02-23 02:03:56 UTC
Created attachment 57509 [details]
Reduced test file
Comment 3 Christina Rossmanith 2012-02-23 02:05:00 UTC
Created attachment 57510 [details]
test file displayed in LibreOffice
Comment 4 Christina Rossmanith 2012-02-23 02:05:44 UTC
Created attachment 57511 [details]
test file displayed in firefox
Comment 5 Christina Rossmanith 2012-02-23 02:11:20 UTC
I've reduced 3424 (7).svg that only a white 1 in a red circle should be displayed (reference: firefox). Some lines are marked with a comment "guilty". If either the <rect> or the marked <g></g> is removed LibO renders the file as a white 1 in a black circle.

I think there are two import problems: a color/gradient problem (the red circle is actually filled with a red gradient) AND a problem with layers hiding things that should be visisble.
Comment 6 Christina Rossmanith 2012-02-23 02:12:42 UTC
(In reply to comment #0)
> Steps to reproduce with "LibreOffice 3.4.4  - WIN7 Home Premium (64bit) German
> UI [OOO340m1 (Build:402)]" :
> 1. downolad sample documents from Bug 34721 - 
>    MinGW FILEOPEN impossible for particular SVG
> 2. Start LibO
>    /Start Center appears/
> 3. Menu 'File -> Open -> select "3425 (7).svg" -> <open>
>    /Document will be opened in DRAW/
>    Expected: looks perfect like in Browser
>    Actual: missing color filling in small circles, so that 
>            white characters seem invisible
> 
> My Seamonkey always repeats the number in the circle right from the circle, but
> that might be a problem with the browser, LibO shows a number shape as a
> (white) outline around the number character.
> 
> 
> Current behavior:
> 
> Expected behavior:
> 
> Platform (if different from the browser): 
> 
> Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20111121
> Firefox/8.0.1 SeaMonkey/2.5


The numbers right from the circle seem to be fine. They are created using a <text> tag and the white numbers are created with a <path> tag.
Comment 7 Jorendc 2013-05-31 22:43:47 UTC
Still reproducible using Linux Mint 15 x64 with LibreOffice Version: 4.2.0.0.alpha0+ Build ID: 467d5e0a2e074ff2afb4d1b1a37cff2094b0895

Opening it using Draw result in good behavior:
* open draw
* file > Insert > From file ...


But opening it in the start center looks like attachment 57510 [details] 

Kind regards,
Joren
Comment 8 Regina Henschel 2013-12-03 19:52:59 UTC
This is a LO only problem, File > Open works in AOO. This bug might have a common reason with bug 40088, which has a similar problem, that the import via Insert > File is correct, but using File > Open imports it wrong.
Comment 9 Julien Nabet 2014-03-30 15:26:36 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
I noticed these logs on console:
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:541: Invalid date: 
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:593: Invalid duration: 
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:541: Invalid date: 
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:593: Invalid duration: 
warn:xmloff.core:6021:1:xmloff/source/core/xmlimp.cxx:757: SvXMLImport::endElement: popped context has wrong prefix
warn:xmloff.core:6021:1:xmloff/source/core/xmlimp.cxx:757: SvXMLImport::endElement: popped context has wrong prefix
warn:legacy.osl:6021:1:svx/source/sdr/contact/viewcontactofsdrpathobj.cxx:67: PolyPolygon object without geometry detected, this should not be created (!)
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:541: Invalid date: 
warn:sfx.doc:6021:1:sfx2/source/doc/SfxDocumentMetaData.cxx:593: Invalid duration:
Comment 10 Robinson Tryon (qubit) 2014-08-29 15:42:06 UTC
Created attachment 105437 [details]
SVG missing color after opening
Comment 11 Robinson Tryon (qubit) 2014-08-29 15:43:33 UTC
Here's another test case:
https://wiki.documentfoundation.org/File:Icon-set-color-smilies.svg

This file renders as expected when inserted into a document in Writer (i.e. matches the rendering Inkscape and FF), but loses all color after opening in Draw (attachment 105437 [details]).
Comment 12 Dennis Roczek 2015-02-17 16:54:12 UTC
I cannot reproduce the problems under win8.1professional x64 with

Version: 4.4.0.3
Build-ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Gebietsschema: de_DE

and
Version: 4.5.0.0.alpha0+ (x64)
Build ID: Built by David Ostrovsky
Locale: de_DE

in draw the reduced test file and robinsons image are both correctly imported. I'm doing the testing for https://wiki.documentfoundation.org/Media_Support/Windows/Image_Tests at the moment. So maybe a Linux only bug?
Comment 13 Yousuf Philips (jay) (retired) 2015-02-17 17:12:07 UTC
Some other documents with missing colors include attachment 104206 [details] and attachment 104207 [details], as only 3 colors appear - black, light blue, and dark blue.

Version: 4.5.0.0.alpha0+
Build ID: f1359d1221b335c4856821948f89868f021135eb
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2015-02-06_17:44:30
Comment 14 Dennis Roczek 2015-02-17 17:17:24 UTC
both images does work here correctly with all colors. (win8.1!) A Linux only problem?
Comment 15 Robinson Tryon (qubit) 2015-02-17 17:46:59 UTC
(In reply to Dennis Roczek from comment #14)
> both images does work here correctly with all colors. (win8.1!)

Further testing with Ubuntu 14.04, trying to open https://wiki.documentfoundation.org/File:Icon-set-color-smilies.svg in Draw.

Already tested:

4.4.0.3 - no color

Testing now:

4.1.2.2 - no color
3.5.7.2 - no color
3.3.0.4 - no color
OOo 3.3.0 - (doesn't open at all)

>  A Linux only
> problem?

Testing on Android (F-droid  - Added on 2015-02-14):

4.5.0.0.alpha0+/3f1713b - Gives error "Unfortunately, LibreOffice Viewer has stopped."
Comment 16 Yousuf Philips (jay) (retired) 2015-02-18 20:41:43 UTC
Created attachment 113480 [details]
screenshot of Pict0.svg

Here is a screenshot of attachment 104206 [details] in Windows 7.

Version: 4.5.0.0.alpha0+
Build ID: 802b80fcd378d5788adff1c7c98af526651a30c2
TinderBox: Win-x86@39, Branch:master, Time: 2015-01-25_10:20:28
Comment 17 Dennis Roczek 2015-02-18 22:43:50 UTC
Created attachment 113485 [details]
Screenshot of colored svg

strange. as i said here it works. is it maybe some ms redistributable which i might have additional installed...

so it is not the libo version (I guess)... i highly doubt thats the win version. give me some time and i check my win7 pc
Comment 18 Dennis Roczek 2015-02-18 22:50:35 UTC
Created attachment 113486 [details]
Screenshot of colored svg in Draw

d'oh here is the screenshot of Draw (under win8.1)
Comment 19 Dennis Roczek 2015-02-18 23:03:08 UTC
Created attachment 113487 [details]
Draw screenshot under Win7Professional N SP1 64bit

a screenshot says more than 1000 words
Comment 20 Regina Henschel 2015-02-18 23:10:01 UTC
(In reply to Dennis Roczek from comment #14)
> both images does work here correctly with all colors. (win8.1!) A Linux only
> problem?

Do you really do File > Open? This issue is not about inserting via Insert > Image. For me on Windows 7 File > Open does not work.

The reason in https://wiki.documentfoundation.org/File:Icon-set-color-smilies.svg is, that the path for the circle is not closed. Add a Z as last command in the path, that will make the smilies filled. But the colors are wrong.

I have added it to meta issue 88277.
Comment 21 Dennis Roczek 2015-02-18 23:15:26 UTC
oh. thanks regina (again). you're right. I imported it incorrectly... :-(
Comment 22 V Stuart Foote 2015-02-19 02:53:32 UTC

(In reply to Regina Henschel from comment #20)
> The reason in
> https://wiki.documentfoundation.org/File:Icon-set-color-smilies.svg is, that
> the path for the circle is not closed. Add a Z as last command in the path,
> that will make the smilies filled. But the colors are wrong.
> 
> I have added it to meta issue 88277.

Actually Vort Artem just patched the svgreader.cxx filter to close non-closed polygons, bug 64075, with http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea91563683b5c5df40ec5f4eb9c3005d7bfcf71d

that aspect is working on current master
Version: 4.5.0.0.alpha0+
Build ID: b13534de022972131b46f93f5ada90af155eec9e
TinderBox: Win-x86@39, Branch:master, Time: 2015-02-19_00:08:56
Locale: en_US

So the Icon-set-color-smilies.svg now displays its colors.  But Open with draw of the Pict0.svg and Pict1.svg continues to lose fill colors--so some additional facet beyond closing polygon.
Comment 23 Xisco Faulí 2015-11-10 14:12:56 UTC
I take this issue. Problem should be fixed after c89ba1dedc511ec17df1e35f8e0696bc20121491, however, it's not working because the id contains an underscore-> #grad_pri1 and it's ignored at parse time here: http://opengrok.libreoffice.org/xref/core/filter/source/svg/parserfragments.cxx#560

The best way to fix this is by upgrading c++ parser spirit::classic to spirit::qi. More info: http://stackoverflow.com/questions/33578440/boostspirit-alnum-p-and-hyphen
Comment 24 Xisco Faulí 2015-11-14 01:13:24 UTC
Fix summited to gerrit: https://gerrit.libreoffice.org/#/c/19961/
Comment 25 Commit Notification 2015-11-15 20:36:26 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=179f693ee0682c1e900f9047dfe67969c09a52f3

tdf#43257 SVG: Id value can contain other characters than alphanumerics

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Robinson Tryon (qubit) 2015-12-17 05:46:56 UTC Comment hidden (obsolete)