document properties->page size units (m, ft) are not remembered correctly

Bug #1268355 reported by Alvin Penner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Low
Unassigned

Bug Description

- Inkscape rev 12902, Windows XP
- load Inkscape with no file
- go to File->Document Properties->Page->Page Size
- set units to m
- save document
- the saved document will have the dimensions below, in 'cm' not 'm'.

   width="21cm"
   height="29.700001cm"

   units="m"

- note the conflict between the two sets of units in the file
- reload the document to confirm that the loaded page size is now in 'cm', not 'm'
- the same thing will happen when using the units of 'ft'. The reloaded file will contain 'in', not 'ft'.
- on occasion sometimes you may see this switch occur live. For example, switch to 'ft'. Keep the properties dialog open. Click on File->Save As. See the units switch live from 'ft' to 'in', in the properties dialog.

- not reproduced with any other units.

- not reproduced in Inkscape 0.48.4. In Inkscape 0.48.4, it appears that the document size is always stored in units of px regardless of what the parameter 'units' is set at, so this particular conversion problem does not arise. This is a much safer way of doing things, since it eliminates the redundancy and the possible conflicts. Example data is:

   width="744.09448"
   height="1052.3622"

   units="ft"

Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 12921.
Not reproduced with 0.48.4.

tags: added: svg units
tags: added: regression
Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.91
status: New → Triaged
Revision history for this message
Alvin Penner (apenner) wrote :

after reading some of the code in the file svg-lenth.cpp, especially the routine called sp_svg_length_get_css_units, it appears that this omission was deliberate, not accidental. It is consistent with the SVG 1.1 spec. In the section called `Ìnterface SVGLength`, there is no mention of `ft`or `m`in the SVG spec.
    I think, in view of this, it would be better to just remove these two options entirely from the choice of document units, to avoid confusion.
    Similarly, I think it would be helpful to remove these two options as well from the choice of default units in the Document Properties dialog, since the use of such units is almost certain to cause an observable amount of numerical round-off error, see Bug 1240455, comments 14, 25, 30

Revision history for this message
su_v (suv-lp) wrote :

Bug #1244861 is another regression which (at least as a visually noticeable effect, I haven't verified if other units produce similar but much smaller incorrect increases of the visual bbox of stroked objects) depends on document units 'm' and 'ft'.

@Alvin - the questions and proposed solutions raised in comment #2 should probably be discussed on the mailing list, to get more input.

Revision history for this message
Bryce Harrington (bryce) wrote :

If we dropped those units would is there any chance of that impacting documents created with 0.48.4?

su_v (suv-lp)
Changed in inkscape:
milestone: 0.91 → 0.92
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Bryce: No, the units are not part of SVG and are not supported in Inkscape other than in 'document-units' and 'units' (which is only used in the Custom Page Size part of the Document Preferences dialog). So they units could be safely eliminated.

I think it would be OK to use these non-SVG units if their use is limited to the GUI or through using an appropriate 'viewBox'. For example:

<svg width="1000cm" height="1000cm" viewBox="0 0 10 10" ...>
  <sodipodi:namedview inkscape:document-units="m" units="m" ...>

Here, the drawing represents a 10m x 10m square where one 'user-unit' is equivalent to 100cm or 1m. This is a completely valid SVG. The user interface would should dimensions in 'm'.

Alvin Penner (apenner)
Changed in inkscape:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.