Comment 9 for bug 1348417

Revision history for this message
David Mathog (mathog) wrote : Re: SVG processed differently from memory and file

status report:

Hacked up the local copy of createNewDocFromMem() so that instead of reading from memory it opens a hardwired file name. That is then passed to createDoc(). That is:

      Inkscape::XML::Document rdoc = sp_repr_read_file("/tmp/simple.svg", SP_SVG_NS_URI);

instead of

    Inkscape::XML::Document *rdoc = sp_repr_read_mem(buffer, length, SP_SVG_NS_URI);

A file "simple.svg" passed in that way is processed incorrectly. The same file opened with open->file is processed correctly.
In both cases, as far as I can tell processing passes through createDoc() with _exactly_the_same_data_ in the call. The problem is that clipping paths (and who knows what else) in defs is not scaled by something createDoc() calls, but text and paths in the main part are. Consequently clipping breaks because the clipping object no longer matches the clipped object.

Conclusion - at the present time createDoc() has either indeterminate output or output that depends upon some program context which is not well documented. In particular, there is nothing about this behavior noted anywhere near createDoc() in document.cpp.

Also tried: adding a doc->ensureUpToDate() immediately after createDoc(), because that has resolved some other mysterious bugs. It did not help here.