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

Cannot render image after setting node SetImage #30

Open
tntobias opened this issue Sep 11, 2020 · 2 comments
Open

Cannot render image after setting node SetImage #30

tntobias opened this issue Sep 11, 2020 · 2 comments

Comments

@tntobias
Copy link

I'm attempting to render a graph containing nodes with png icons.

node, _ := graph.CreateNode("mynode")

node.SetImage("/path/to/image.png")

When the graph is rendered:

g.RenderFilename(graph, "png", "mygraph.png")

I'm getting an error:

No loadimage plugin for "png:png"

Rendering to "dot" format and creating the image with graphviz works as intended.

I've attempted to troubleshoot and as near as I can tell, the pango/cairo plugin must be enabled to allow this but I'm not familiar enough with the C/Go bindings to know how this could be done. For what it's worth, I've tried #define HAVE_PANGOCAIRO 1 in /internal/config.h to no effect.

Any guidance on how I could enable this?

@kheadjr-rv
Copy link

I ran into this issue as well and unfortunately could not get PNG to work.

So to work around this all I did was change it to SVG and that worked without any issues.

m.SetImage("icon_64.svg")

if err := g.RenderFilename(graph, graphviz.SVG, "graph.svg"); err != nil {
	log.Fatal(err)
}

Hope this perhaps help you.

@CiucurDaniel
Copy link

Currently running into the same issue: error rendering graph to jpg: No loadimage plugin for "png:jpg"

Is there any known fix for this? Issue is already 4 years old.

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

3 participants