Is Graphviz dependency discardable?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Is Graphviz dependency discardable?

Post by Pander »

Hi all,

I use both Graphviz and ImageMagick but what puzzles me is the dependency that ImageMargick had on libgraphviz. Why is that there? What functionality does ImageMagick use from Graphviz?

Since, I'm using development version of Graphviz, my package manager keeps complaining that libimagemagick is missing libgraphviz. Is this dependency really necessary? Do alternative ways exist to couple them without the package dependency? It would make the building process and pakcage management a lot easier if the depency can be dropped one way or the other.

Thanks,

Pander
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

GraphViz is an optional dependency. Add --without-gvc to the configure command line then rebuild / reinstall ImageMagick to disable DOT support.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

I'm referring to distribution (Ubuntu) package level. But in order to decide what to choose, can anyone tell me for what functionality this dependency is for?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

We do not build nor maintain the Ubuntu ImageMagick distributions.

The Graphviz delegate library is required to render DOT files.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

I have asked around on the Graphviz development mailing list and there I found out that the way ImageMagick is rendering DOT or GV files is far from trivial. DOT or GV files can be processed by the executables dot, neato, fdp, sfdp, twopi, circo and more. See the images on the right hand side under Roadmap on http://www.graphviz.org/

These image are completely different and only the end user knows what tool he or she would like to use on the DOT or GV file. Unfortunately, this cannot be derived from the file itself. You can read the reply here https://mailman.research.att.com/piperm ... 01196.html I think many prefer no rendering over incorrect rendering.

I understand that Ubuntu can choose which options to use when building packages. If ImageMagick is only using Graphviz for the reason described above, I would be inclined to request Ubuntu to drop the dependency and the Graphviz rendering in ImageMagick since I cannot identify no advantages only disadvantages. Dropping this dependency would easy the way for upgrading to Graphviz development releases. libimagemagick is the only package depending on libgraphviz.

I really appreciate the work which is done by the ImageMagick community and I use the tools a lot. If ImageMagick maintainers also see no reason any more in rendering DOT or GV files (since wrong output can be much worse than no output at all), I would like to request ImageMagick to consider dropping Graphviz support all together. This will eventually trickle downstream to distributions which will also drop the dependency.
AndyDent

Re: Is Graphviz dependency discardable?

Post by AndyDent »

Pander wrote:DOT or GV files can be processed by the executables dot, neato, fdp, sfdp, twopi, circo and more.... and only the end user knows what tool he or she would like to use on the DOT or GV file.
As a convention, it's a fairly safe assumption that the user wants to run the dot tool, it's by far the dominant use of the GraphViz libraries.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

ImageMagick will continue to support rendering DOT files. It is up to the Ubuntu maintainers to decide if they want to include DOT support with the Ubuntu distribution. ImageMagick calls the GraphViz API to render DOT files. If they are rendered incorrectly then there is a bug in the GraphViz API or in the way ImageMagick uses it. Post a URL to an DOT file that is rendered incorrectly and a URL to the correct rendering. We will account for the differences and produce a patch to fix the problem.

Even if GV files are abstract, there is some value in rendering them.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

Here is an example, a typical gv file for twopi rendered properly with twopi:
http://img696.imageshack.us/img696/3744 ... hot1ob.png

and rendered incorrectly with dot:
http://img39.imageshack.us/img39/3541/screenshot2lg.png

Of course you decide what ImageMagick should do with these files, but I wanted to show these examples what sometimes the implications can be.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

Try this:
  • convert -define dot:layout-engine=twopi twopi.gv twopi.png
If it fails, you may need to upgrade your release of IM.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

Thanks for the options to try out. See below the result.

Code: Select all

$ dpkg -l |grep -i imagema
ii  imagemagick                           7:6.5.1.0-1.1ubuntu3                       image manipulation programs
ii  imagemagick-doc                       7:6.5.1.0-1.1ubuntu3                       document files of ImageMagick
ii  libmagick++2                          7:6.5.1.0-1.1ubuntu3                       object-oriented C++ interface to ImageMagick
ii  perlmagick                            7:6.5.1.0-1.1ubuntu3                       Perl interface to the ImageMagick graphics r

$ convert -define dot:layout-engine=twopi ano.twopi twopi.png
Error: canvas size (17320,14693) exceeds PDF limit (14400)
	(suggest setting a bounding box size, see dot(1))
Error: /invalidfont in /findfont
Operand stack:
   --nostringval--   coordfont   Times-Roman
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1820   3   4   %oparray_pop
Dictionary stack:
   --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:76/200(L)--   --dict:3/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 1166
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
Error: /invalidfont in /findfont
Operand stack:
   --nostringval--   coordfont   Times-Roman
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1820   3   4   %oparray_pop
Dictionary stack:
   --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:76/200(L)--   --dict:3/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 1166
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
convert: Postscript delegate failed `/tmp/magick-XXuwgKAJ': No such file or directory @ ps.c/ReadPSImage/742.
convert: missing an image filename `twopi.png' @ convert.c/ConvertImageCommand/2775.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

In the Beta release of ImageMagick, we use SVG rather than Postscript / PDF. If you post a URL to your image, we'll let you know if it renders properly with the SVG device.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

We need a URL to the original GV graph file. We are confident it will render we just want to confirm.
Pander
Posts: 10
Joined: 2010-06-05T06:08:38-07:00
Authentication code: 8675308

Re: Is Graphviz dependency discardable?

Post by Pander »

Oh, I have send that in a personal message to you. Can you find it?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Is Graphviz dependency discardable?

Post by magick »

We did not get a PM from you. You can also send it to graphviz at imagemagick.org.
Post Reply