Share

Zoomable Visual Transformation Machine

Tracker: Bugs

5 Failure to parse SVG - ID: 1611297
Last Update: Comment added ( epietrig )

When loading a Graphvis generated SVG with ellipses for nodes, it fails to
parse the file. The SVG parser is expecting some of the ellipse parameters
to be "Long" when they are in fact more like "Double" values. I made a
quick local change to see if the file could be loaded. I changed:

SVGReader.createEllipse(Element,Context,boolean) from:

long w=(Long.valueOf(e.getAttribute(_rx))).longValue();
long h=(Long.valueOf(e.getAttribute(_ry))).longValue();

to:

long w=(Double.valueOf(e.getAttribute(_rx))).longValue();
long h=(Double.valueOf(e.getAttribute(_ry))).longValue();

SVGReader.getNextNumber(StringBuffer) from:

while ((sb.length()>0) && ((Character.isDigit(sb.charAt(0))) ||
(sb.charAt(0)=='-'))){

if (dgb.length()>0){res=(Integer.valueOf(dgb.toString())).intValue();}

to:

while ((sb.length()>0) && ((Character.isDigit(sb.charAt(0))) ||
(sb.charAt(0)=='-') || sb.charAt(0)=='.')){

if (dgb.length()>0){res=(Double.valueOf(dgb.toString())).intValue();}


I have attached a test case with ellipses.

Ryan


Ryan Gustafson ( rgustav ) - 2006-12-08 05:32

5

Closed

Fixed

Emmanuel Pietriga

None

None

Public


Comments ( 2 )




Date: 2006-12-08 08:16
Sender: epietrigProject Admin


I tried your test case. It works fine now.


Date: 2006-12-08 08:12
Sender: epietrigProject Admin


I noticed this problem yesterday. It seems to happen only with the latest
versions of GraphViz (did happen with 2.12, not with 2.8) which introduce
non-integer values in shape coordinates and size. The fix is already in
SVN. I intend to make a 0.7.1 release some time next week to make this fix
available as well as the fix for bug #1606766.



Log in to comment.

Attached File ( 1 )

Filename Description Download
ApplicantInitialApplicationStateMachine.zip Test case SVG (zipped) Download

Changes ( 5 )

Field Old Value Date By
status_id Open 2006-12-08 08:16 epietrig
close_date - 2006-12-08 08:16 epietrig
resolution_id None 2006-12-08 08:12 epietrig
assigned_to nobody 2006-12-08 08:12 epietrig
File Added 206306: ApplicantInitialApplicationStateMachine.zip 2006-12-08 05:32 rgustav