0

I am trying to display a diagram imported with draw.io editor and saved as xml file. To parse and render the diagram's xml I use the mxGraph library that display it correctly except for the encoded images. I mean this part of the xml:

<mxCell style="vsdxID=65;fillColor=none;gradientColor=none;image;aspect=fixed;image=data:image/jpg,/9j/4AAQSkZJRgABAQAAAQABAA...

all other aspects are handled fine (shapes, color, lines, ...) but the data:image/jpeg is simply ignored. I don't have any error in console nor broken img tags are generated or similar things.

What/where coukd be the problem?

Marco

  • is there a conflict between the 2 "image" keys you have there ? can you try with another image ? (you can generate the base64 code here https://www.base64-image.de/ ) – Colin Claverie Sep 06 '19 at 08:48
  • I tried to remove the first 'image' but nothing is changed and I did also many other attempts with different images. I think the problem is in the way draw.io generates the xml, with lots of stuff inside style attribute... maybe I am missing some css reference or similar. I am going to ask to draw.io team about this. – Marco Azzalini Sep 09 '19 at 10:09

1 Answers1

0

Ok, I got it by myself... thanks to Colin tip! The solution is to change

figure;

in

shape=figure;

and the picture is rendered as expected :-) Probably it is a bug in the draw.io import/export functionality