
Hello everyone,
I just tried to embed images in a new Inkscape document, created with a recent SVN build of Inkscape, and it did not work. Here is the problem (it's quite tricky):
The SVG document comes from a computer with a different directory organization. It has images linked in it, that are in the same directory that the document. I open it on my machine and copy parts of it (some paths + some bitmaps) to a new, untilted document. Inkscape copies the images with xlink:href containing a relative link to the image (just the name in this case) and sodipodi:absref which is not valid anymore (it contains the directory structure of the other machine). In the new document, images initially appear as broken links since the absref is not valid and the document has not been saved, hence the root is unknown.
I save this new document next to the orignal one, so that the relative links are respected. Once saved, the xlink:href become valid but the images are still show as broken. I have to reopen the document to see the images (which is probably a problem in itself).
In the XML editor, just to be sure, I deleted the sodipodi:absref elements which were not valid anyway.
Then I tried to embbed the images and Inkscape complained saying "No xlink:href or sodipodi:absref attributes found, or they do not point to an existing file! Unable to embed image. Sorry we could not locate /Applications/Inkscape.app/ u_velocity_bottom.png" The absref attributes are not there so that's fine but the xlinks are valid. However Inkscape looks for images in /Applications/ Inkscape.app which is the default location where documents are saved on OS X. If I remember well there was a document root attribute that was removed some time ago. I suspect that embbed bitmaps was looking for the images as document root+xlink and since document root is inexistant the default is used. This means that embbed images only works when sodipodi:absref is present, now that document root does not exists. This seems like a bug to me but the problem was complicated so I would prefer having your advice. Did I explained it clearly?
Well currently I'll have to rewrite the sodipodi:abserf by hand and it will solve the problem but the solution may be quite hard to find for somebody who does not want to dive in the XML editor.
JiHO --- http://jo.irisson.free.fr/