Open mgzob opened 5 months ago
Diagrams.net will produce an <image>
tag:
<image xmlns="http://www.w3.org/2000/svg" x="120.5" y="1.5" width="80" height="80" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://app.diagrams.net/img/lib/clip_art/computers/Printer_Commercial_128x128.png"/>
As you can see, the base URL is the server URL.
In our case, the diagrams.net server is not accessible and we are using a local HTML page to generate the SVG. As a result, the href
is:
<image x="120.5" y="1.5" width="80" height="80" xlink:href="file:///path/to/diagrams.net/assets/img/lib/clip_art/computers/Printer_Commercial_128x128.png"/>
I don't want to serve assets from https://kroki.io. The objective has always been to convert text diagrams into self-contained images (i.e., without any connection to kroki.io).
I don't know if diagrams.net supports embedding png/jpeg images into SVG (using data URIs)? If not, you should probably create a feature request. If it does, then we could configure the export to use that mode.
Diagrams.net does not appear to handle
clipart
based images found locally to the diagrams.net docker itself.This only occurs when an object is referenced via a local path:
image=img/lib/clip_art/computers/Printer_Commercial_128x128.png
In the lambda icon to the left it is accessed via mxgraph:
shape=mxgraph.aws3.lambda_function
The icons are indeed stored in the docker image. They're copied over at this line, and I can validate they are present at:
/usr/local/kroki/assets/img/...
They do not appear to be resolving properly however when used in a diagram.
For replication, here is the xml for the above diagram:
This does resolve properly in the diagramsnet web or local application.