Skip to content
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

[feature] Enable base64-encoded images in the YAML input #322

Open
kvid opened this issue Jul 18, 2023 · 1 comment
Open

[feature] Enable base64-encoded images in the YAML input #322

kvid opened this issue Jul 18, 2023 · 1 comment

Comments

@kvid
Copy link
Collaborator

kvid commented Jul 18, 2023

Two possible ways to obtain this:

  • Allow image.src to be a base64-encoded image prefixed with e.g. "data:image/png;base64, " as an optional alternative to a filename - similar to what is allowed in HTML, as described in Embed images in SVG output #189 (comment). This option is simple and doesn't change any input YAML syntax. Inheritance might be used for space efficiency when the same image is used several places in the harness.
  • Allow an optional top level images section containing a dict with image filenames as keys and base64-encoded images as values (the prefix mentioned above is probably also needed here to specify image format). This option is more space efficient when the same image is used several places in the harness. This option might also enable overriding the file system when needed.
  • Edit: A variation of the latter alternative above, is an optional top level attachments section to also enable embedding other files than images, e.g. HTML template files or some other external files we might support in the future.

A functionality like this might help in use cases where separate image files can cause problems, like in #233 and #320.

@kvid
Copy link
Collaborator Author

kvid commented Jul 18, 2023

It's described in #189 that Graphviz doesn't support base64-encoded images, so we probably would need to decode them into temporary image files in the preparation phase. That will also be good for the aspect_ratio() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant