-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images not showing up when exporting to SVG or PNG on play.d2lang. #1985
Comments
on windows, svg export is fine but png has no icons. #1983 (comment) |
Facing the same issue, I'm using chromeOS, Chrome. I tried unify image format with svg as I was using both png and svg but still didn't work. |
I've had this issue for years and every now and then I spend a few hours trying to find a solution. Chrome doesn't even make a request for the icons referenced in my exported .svg 🤨 Today, thinking it could be related to CORS somehow, I downloaded the .svg for all the icons so there are no cross-site requests. No matter what I try, the icons are visible on the playground but not when I open a page that references the exported .svg. It's the same result whether served locally (via mkdocs) or through Cloudflare Pages. |
i tried it on windows edge, now. |
I forgot to mention, that I have the same problem in Safari. Late last night it occurred to me that I hadn't tried opening the .svg directly. That worked! All the icons are shown. The solution is to change this (which mkdocs generates):
To this:
If only I had thought of this two years ago 🙄 @bo-ku-ra as you mention above, my icons do not appear in the exported .png either, but I suspect that's an issue on the Playground backend. |
"<object>" uses the svg's own path. (ex. pods.svg) root/
├ index.html
└ svg/
├ pods.svg
└ images/
└ foobar.png
pods.svg (the caller is index.html)<img src="svg/images/foobar.png"/> is correct. |
Edit: I am on Windows, using Firefox if it makes a difference for the issue.
Simple sequence diagram:
When I export the above, the images are not being added to either the PNG or SVG outputs.
The text was updated successfully, but these errors were encountered: