Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002100graphvizOutput Generationpublic2011-06-06 05:262011-06-11 13:18
Assigned To 
PlatformOSOS Version
Summary0002100: svg dpi setting not reflected in image size
DescriptionWithout setting dpi:

<svg width="88pt" height="236pt"
 viewBox="0.00 0.00 88.00 236.00"

When setting dpi=96:

<svg width="117pt" height="315pt"
 viewBox="0.00 0.00 88.00 236.00"

When setting dpi=60:

<svg width="73pt" height="197pt"
 viewBox="0.00 0.00 88.00 236.00"

Without setting the dpi the image width/height coincides with the viewBox, which means the canvas is correctly sized to the contents of the image. But when setting the dpi these two values don't coincide and they should (right?)
TagsNo tags attached.
VERSION2.26.3 (20100126.1600)
Attached Filesdot file icon [^] (38 bytes) 2011-06-11 13:17
html file icon demo.html [^] (342 bytes) 2011-06-11 13:18
? file icon demo-default.svg [^] (1,336 bytes) 2011-06-11 13:18
? file icon demo-dpi60.svg [^] (1,350 bytes) 2011-06-11 13:18
? file icon demo-dpi60-fixed.svg [^] (1,350 bytes) 2011-06-11 13:18
? file icon demo-dpi96.svg [^] (1,348 bytes) 2011-06-11 13:18
? file icon demo-dpi96-fixed.svg [^] (1,348 bytes) 2011-06-11 13:18

- Relationships

-  Notes
User avatar (0000021)
ellson (administrator)
2011-06-11 12:42

I'm not sure what DPI means when talking about a vector format like SVG; or what you think it means?

Could you please provide a test case, source graph, with outputs and/or detailed description of what doesn't look right?
User avatar (0000022)
numerodix (reporter)
2011-06-11 13:17
edited on: 2011-06-11 15:52

I think the idea is that vector images have no particular resolution since they are scalable, nevertheless when you render a vector image you must necessarily choose to render it at a specific resolution. And this resolution is written into the file:

<svg width="62pt" height="120pt" viewBox="0.00 0.00 62.00 120.00"....

There is a further scaling parameter also:

<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 116)">

Now, while I will say right off that I don't know how these parameters combine to produce a resolution in pixels (when I open the image in Google Chrome it seems to be about 80x160), they do have a correspondence such that the "width" and "height" agree with the "viewBox" which displays the image in its entirety.

However, when you set a dpi in graphviz for the image the correspondence is broken.

I'm attaching a web page with images to demonstrate the problem.

- Issue History
Date Modified Username Field Change
2011-06-06 05:26 numerodix New Issue
2011-06-11 12:42 ellson Note Added: 0000021
2011-06-11 13:17 numerodix Note Added: 0000022
2011-06-11 13:17 numerodix File Added:
2011-06-11 13:18 numerodix File Added: demo.html
2011-06-11 13:18 numerodix File Added: demo-default.svg
2011-06-11 13:18 numerodix File Added: demo-dpi60.svg
2011-06-11 13:18 numerodix File Added: demo-dpi60-fixed.svg
2011-06-11 13:18 numerodix File Added: demo-dpi96.svg
2011-06-11 13:18 numerodix File Added: demo-dpi96-fixed.svg
2011-06-11 15:51 numerodix Note Edited: 0000022 View Revisions
2011-06-11 15:52 numerodix Note Edited: 0000022 View Revisions

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