Apache OpenOffice (AOO) Bugzilla – Issue 118728
linked svg graphic looses link
Last modified: 2012-09-21 03:19:36 UTC
Created attachment 77102 [details] svg graphic for testing Save the attached svg-graphic to your PC. Open a new Writer document. Insert the svg-graphic as linked graphic. Save the document and close it. Reopen the document. Notice the read error. The link is still listed in Edit > Links..., but the graphic is not loaded.
Please put confirmed issues directly to NEW Changed Status: NEW
ALG: Happens as desrcibed. The 'Read error' also comes up initially with e.g. a gif, but Writer will then load and show it. Checking where the difference is between a gif Writer graphic object and a Svg one...
ALG: Seems as if the Svg provided does not have a DOCTYPE identifier which I used for Svg identification in ImpPeekGraphicFormat (svtools). Checking Svg spec if this is allowed to not have it...
Hi Armin, it is recommended not to have it, see http://www.w3.org/TR/SVG/intro.html#MIMEType, last sentence.
now the correct one http://www.w3.org/TR/SVG/intro.html#NamespaceAndDTDIdentifiers
ALG->Regina: Thanks for the hint, very useful. I already looked at that definitions. I formally used the following checks (for the first 256 bytes): - 'DOCTYPE' is part of it - 'svg' is part of it I now modified to use: - '<?xml' -> identify as Xml at all - 'version' -> also Xml, but also Svg - 'www.w3.org' -> has to do with w3, part of Svg namespace definition - '<svg' -> contains (at least) one Svg node Comments?
ALG: Comitted, waiting for comments, but done so far.
If the document has a Doctype declaration, it is possible, that '<svg' is not inside the first 256 bytes. This happens, because it is allowed that a Doctype contains an internal DTD subset. Such an example is given in chapter "3.2. SVG as the Host Language" in http://www.w3.org/TR/XHTMLplusMathMLplusSVG/. Therefore the simple test '<svg' might fail. Perhaps a combining test with '<svg' || ('DOCTYPE' && 'svg') is safer.
ALG: You are correct, I stubled already over files with lot of comment text where '<svg' was outside the 1st 256 bytes. I have now changed to do the following: (1) if(check('<?xml', 256) && check('version', 256))) (2) if(check('DOCTYPE', 256) && check('svg', 256)) (3) else if(check('<svg', 256)) (4) else if(check('<svg', fullsize)) (5) is_svg; Seems okay and handles all cases I stumbled upon. If 1-3 fails, evtl. the full file is checked, but should happen very rarely.
ALG: Woks as expected, checked in, done.
verified on the build AOO3.5_r1387482