languitar / drawio-batch

Command line converter for draw.io diagrams
65 stars 12 forks source link

images draw as colored blocks #7

Closed itswg closed 5 years ago

itswg commented 5 years ago

Shapes that are images draw as colored blocks when run through batch processor.

draw_io_test_drawiobatch

Exporting directly from application renders images properly. draw_io_test_exported

original document (remove ".txt" ) draw_io_test.xml.txt

itswg commented 5 years ago

@languitar, not sure if you get notified automatically or if just when called out.

languitar commented 5 years ago

Interesting, I have no idea what is going on there and how such images are maintained by drawio. Will take some time to debug this.

itswg commented 5 years ago

Thank you. I wasn't able to go deep on debugging it myself in the nodejs environment.

languitar commented 5 years ago

After a quick look I am also puzzled what is happening here. However, I might have to do some serious restructuring to the code anyway as it seems that picture generation has changed a lot upstream now. Might take some more time.

languitar commented 5 years ago

CORS was the issue, which prevented the external images from being loaded.

itswg commented 5 years ago

Thank you! This was a big improvement. Strangely, one of the images in your test still fails (the gray box).

test

Thanks for your time on the issue.

languitar commented 5 years ago

Interesting. Do you know where that shape comes from? I can't find it in the drawio library.

languitar commented 5 years ago

This still seems to be another facet of CORS. I think that image from AWS3D needs a custom javascript function for rendering correctly. However, somehow, despite adding some flags, chromium refuses to load the script for file:// uris.

itswg commented 5 years ago

Interesting.... I just grabbed a bunch of AWS shapes. It's strange that some load, but not others. Why would this one be a file:// uri? What are the others?

languitar commented 5 years ago

Internally, I use the webpage that also drawio online uses for rendering the images. But in my case, it is served from file systems and in that case usually browsers prevent fetching resources from different origins. But I don't fully understand why this applies here and only for the executable code.