Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002181graphvizDotpublic2012-01-04 11:152012-01-06 10:34
ReporterCompumatica 
Assigned Toerg 
PriorityurgentSeverityimportantReproducibilityhave not tried
StatusassignedResolutionreopened 
PlatformLinuxOSopenSUSEOS Version11.1
Summary0002181: Parameter "imagepath" may not work as described...
DescriptionHello all,

primary I'm looking for a possibility to put all my ".png"-images in a folder and load them via "http" and to generate from a ".dot" file a".png"- or ".jpg"-Graph. Unfortunately I didn't find out, whether it's possible or not.

Can you help me with a code example, if it's possible?...

On my 2nd attempt I decided to put all these images to a folder using the "imagepath" attribute and tried to create a work around:

digraph G
{
  imagepath="~/Desktop/png/";
  a[ shape=box image="a.png" ];
  b[ shape=box image="b.png" ];
  a->b;
}

alternatively

digraph G
{
  imagepath="/home/username/Desktop/png/";
  a[ shape=box image="a.png" ];
  b[ shape=box shapefile="b.png" ];
  a->b;
}

...both versions also didn't work:

Warning: No such file or directory while opening a.png
Warning: No or improper image="a.png" for node "a"
Warning: No such file or directory while opening b.png
Warning: No or improper shapefile="b.png" for node "b"

... and so on :o(

Can you help me with a code example, how to deal with the "imagepath" parameter due to my intentions?...

Thanks

Chris, Germany
Steps To Reproducesee above...
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSIONdot - graphviz version 2.28.0
Attached Files

- Relationships

-  Notes
User avatar (0000144)
erg (administrator)
2012-01-04 11:46

The first example definitely won't work, as Graphviz does not do any interpretation of the imagepath string. In particular, it will try to do an
fopen("~/Desktop/png/a.png","r"), which will fail. Unless there is a user on your machine with the ID username, the second example will fail for the same reason.

You can make a modification request for such semantics, but meanwhile, you will need to supply concrete pathnames for the imagepath attribute. If you want to make this user dependent, you can use a preprocessor on the dot file to make the substitution.
User avatar (0000145)
ellson (administrator)
2012-01-04 11:53

This didn't work in 2.28.

With a recent 2.29 snapshot, no support for "~", but the second form worked for me.
User avatar (0000146)
erg (administrator)
2012-01-04 11:57

Sorry, yes, as John notes, the imagepath feature wasn't added until last September, so it is only supported in 2.29 and later. Unfortunately, our documentation mostly reflects the most recent version of the software.
User avatar (0000147)
ellson (administrator)
2012-01-04 11:59

You can also use command-line substitution:

    dot -Tpng -Gimagepath="$HOME/Desktop/png" test.gv
User avatar (0000151)
Compumatica (reporter)
2012-01-06 08:07
edited on: 2012-01-06 08:10

Thanks for your quick and extensive help - after I've installed the newest version, it worked properly ;-)

Just to clarify my primary purpose question: Is it possible to place such a file path as an URL, too?... I'm highly interested to generate such graphs via internet, if possible:

digraph G
{
  a[ shape=box image="http://url/png/a.png" [^] ];
  b[ shape=box shapefile="http://url/png/b.png" [^] ];
  a->b;
}

alternatively

digraph G
{
  imagepath="http://url/png/"; [^]
  a[ shape=box image="a.png" ];
  b[ shape=box shapefile="b.png" ];
  a->b;
}

Thanks for your help again...

Chris, Germany

User avatar (0000152)
erg (administrator)
2012-01-06 10:22

We used to support this, but it became apparent that this created security holes, so we removed the code. If you are compiling your own version, it would be fairly simple to add it back.
User avatar (0000153)
Compumatica (reporter)
2012-01-06 10:34
edited on: 2012-01-13 10:04

Thanks for your offer - of course, I'll compile my own version, would you add it back for me?... If you'd like to send me the sources, please mail at [email protected]

Thanks

Chris, Germany


- Issue History
Date Modified Username Field Change
2012-01-04 11:15 Compumatica New Issue
2012-01-04 11:46 erg Note Added: 0000144
2012-01-04 11:48 erg Assigned To => erg
2012-01-04 11:48 erg Status new => resolved
2012-01-04 11:48 erg Resolution open => no change required
2012-01-04 11:53 ellson Note Added: 0000145
2012-01-04 11:57 erg Note Added: 0000146
2012-01-04 11:59 ellson Note Added: 0000147
2012-01-06 08:07 Compumatica Note Added: 0000151
2012-01-06 08:07 Compumatica Status resolved => feedback
2012-01-06 08:07 Compumatica Resolution no change required => reopened
2012-01-06 08:09 Compumatica Note Edited: 0000151 View Revisions
2012-01-06 08:10 Compumatica Note Edited: 0000151 View Revisions
2012-01-06 10:22 erg Note Added: 0000152
2012-01-06 10:34 Compumatica Note Added: 0000153
2012-01-06 10:34 Compumatica Status feedback => assigned
2012-01-13 10:04 Compumatica Note Edited: 0000153 View Revisions


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker