EDIT - THIS IS NO LONGER A PROBLEM - the utility now handles âLinkedâ images as well as âEmbeddedâ ones. â Elusien (2021-02-02)
Problem analysis and resolution
Most of the testing I have done with SVGs has been with those created by Inkscape, while your SVG is created using Intaglio. When Inkscape saves an SVG, all of the elements, Paths included, have an ID attribute, e.g. id=âpath123â, as can be seen in my screenshot above. Intaglio does not do this, so the paths have no IDs. I have code in my utility to get around this, but there was an end-case, which I have now fixed. I have updated the utility on my webpage, so changes to the âstartâ and âdurationâ now work.
1 bug fixed, 1 to go: When you import an image (jpeg/png etc) into Inkscape you have the option to either âEmbedâ the image or âLinkâ it. I have always used âEmbedâ. This converts the image to text using Base64 encoding. If you use âLinkâ, it is similar to Shotcut - it just makes a link to the file on disk. The SVG created by Intaglio uses the second method (see the âhrefâ below:
<image xlink:href="7fbaa1d521b0.png" width="1280" height="720" transform="matrix(1,0,0,1,0,0)"/>
This is a major problem since the utility will try to load the file â7fbaa1d521b0.pngâ as if it existed on my web-server in the UK, not from your local disk, since browsers are not allowed to access your local disk. There are 3 possible solutions to this.
-
When you load the image in Intaglio tell it to Embed the Image, not âLinkâ it. I donât know if Intaglio has such as option, but if it does this is by far the easiest option.
-
Open your SVG file in Inkscape. Select the map. Delete the selection. Import the PNG image (EMBEDDED). Move its layer lower than that of the tracing. Position it to the correct place. Save as a new SVG and use that in my utility. I just tried that and it took me less than 1 minute.
-
Convert the image to text using Base64 encoding (there are online converters e.g. https://www.base64-image.de/) and use a text editor to replace the above <image> element - Iâll describe this in more detail on my website.
-
Modify my utility to recognise Linked images, ask for the userâs permission to access this file on their local disk, convert it in the javascript to Base64 encoding and then be able to work as before. This is more difficult, but can be done, although it may take me a day or two to do the coding and test it. I will do this nevertheless as I have done something similar before and know that it isnât too difficult.
As I said, if you need to do something quickly, see if option 1) is possible with Intaglio, or use option 2. If you are confident enough, try option 3. If you can wait, then wait for option 4.