Different values in svg save file than in tool itself

General discussions about Inkscape.
bendenton
Posts: 1
Joined: Wed Feb 01, 2017 7:39 pm

Different values in svg save file than in tool itself

Postby bendenton » Wed Feb 01, 2017 7:50 pm

When I create a, for example a rectangle, with a height, width, x & y parameters using the tool the numbers are different in the svg save file. I can't see the relation. I'm using the save file values to generate these shapes in another tool but the values are throwing me off. I've attached some images below.

The values are correct when I reload the image into inkscape so what is inkscape doing to these values?
Attachments
Capture2.PNG
Capture2.PNG (14.57 KiB) Viewed 1315 times
Capture.PNG
Capture.PNG (141.58 KiB) Viewed 1315 times

ShawnWDion
Posts: 70
Joined: Fri Apr 22, 2016 8:32 am

Re: Different values in svg save file than in tool itself

Postby ShawnWDion » Wed Feb 01, 2017 10:12 pm

in your SVG find this line.

inkscape:document-units="mm" <---Mine says mm but in inkscape I'm on px

on a 500x500 px

width="132.29167"
height="132.29167"

So chances are your SVG has a different save units and your other program is ignoring this format change.

Check under Document properties to change both screen and file save to the unit order you require.

ShawnWDion

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Different values in svg save file than in tool itself

Postby tylerdurden » Wed Feb 01, 2017 11:06 pm

There are at least three things happening:

1) Inkscape screen coordinates have 0,0 at bottom-left, svg coordinates have 0,0 at top-left. Inkscape does the conversion.
2) If the object(s) have been moved or scaled (transforms) this may be reflected in the transform matrix until saving, depending on the setting in prefs.
3) The bounding box location and dimension can show a difference from the xml depending on the setting in prefs.
4) External tools may scale differently than Inkscape, depending on the version of the external tool and the version of Inkscape you are using.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Different values in svg save file than in tool itself

Postby Moini » Thu Feb 02, 2017 8:36 am

From the values, this looks to me as if the stroke of your rectangle causes the difference. The stroke doesn't count to a rectangle's width in the svg, but it may count into the values displayed for the selection tool, depending on the setting about the bounding box to use (Edit -> Preferences -> Tools: Bounding Box to use).
If you remove the stroke (so the visual and geometrical bounding boxes are identical), both sizes should match, unless there is some other kind of additional conversion going on, as described by tylerdurden in 2).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “General Discussions”