Inkscape-created svg is rendered differently in Inkscape and Chrome

Bug #1546099 reported by Pavils Jurjans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Please consider the attached svg file.

It contains two objects, a line and a rectangle, that appear of equal width, when viewed in Inkscape. The line is a <path> element with node coordinates in pixel units, but the <rect> object is defined using mm units.

When this svg is opened in Google Chrome, the rectangle is slightly wider.

Apparently Inkscape and Chrome use different px/mm ratios. Isn't there some generally agreed standard about this ratio? Or maybe there is some way how to define this ratio in svg file?

I understand that using mixed units is generally bad idea, but it causes me problems in much more complex solution than just this attached example.

Tags: units
Revision history for this message
Pavils Jurjans (passiday) wrote :
Revision history for this message
Mc (mc...) wrote :

which inkscape version ? Tried here with Inkscape 0.91 r13725, no problem (line is way smaller, as rendered in chromium and in firefox)

The px/mm is defined in the file : <svg [...] width="120mm" height="100mm" viewBox="0 0 425.19685 354.33071" [...]
indicates that 1mm = 3.5433 px (aka user units)

Revision history for this message
Pavils Jurjans (passiday) wrote :

I use 0.91, release number does not appear in the About dialogue (a bug? :). Even in commandline I get this:

$ inkscape --version
Inkscape 0.91 r (Feb 12 2015)

Ok, to the topic: I attached updated svg file and two screenshots, to clarify the problem. Maybe I am wrong to expect the two images be identical, but then I'd like to understand where am I wrong.

The problem creeps up when the svg that is made in Inkscape, with certain dimensions in mms, is loaded in Chrome, and then JavaScript adds to the loaded svg document new <rect> elements, using mm units for x, y, width and height attributes. What is drawn in the Inkscape, is registered in the svg file using pixel units, but in the Inkscape interface it is clear that the top rectangle is 100mms wide. If the second <rect> with identical dimensions (in mm) is afterwards added in Chrome, it appears longer. Inkscape renders both rectangles of identical width - as expected.

Perhaps I should just post this issue in Chrome forum, because it is Chrome where the rendering goes bad.

Revision history for this message
Mc (mc...) wrote :

Ok, maybe i go the spec wrong, because
- i would tend to agree with inkscape .91 rendering
- the development version shows the same as chrome and firefox. It uses 96px/in so the 96/90 difference might explain it (but the information in the file should still be used... ? )

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.