QR Code styling issue: no fill but border and complicated path

Summary:

Major issue:

  • When generation a QR-Code, the result is broken: instead of black squares, there are lines. The issue comes from the construction of the QR-Code svg.

Minor issues:

  • Even if rounded corners are beautiful, it should be possible to switch it off (rounding setting of 0,00 and not 0,01), in order to have a shorter path and according to the legend of this setting that indicate a value from 0 to 1.
  • path is composed of real values that get rounded or simplified according to user settings: that could lead to loss of details.

Steps to reproduce:

My settings: width="210mm" height="297mm" viewBox="0 0 210 297" version="1.1"

just select the QR-Code generator and render a text "This is a test", no matter the encoding, error correction, size... I'm using "auto" for the QR-Code matrix size setting to let the tool choosing the best one.

What happened?

The major issue lie to the structure of the generated svg: the path containing the QR-Code is nested inside a useless group and the styling is applied on that group rather than to the path.

There's the simplified svg obtained:

<g inkscape:label="QR Code: This is a test" transform="matrix(0.26458,0,0,0.26458,178,270)" id="g1212">
  <rect x="0" y="0" width="66.0" height="66.0" style="stroke:none;fill:white" id="rect429" />
  <g style="stroke:none;fill:black" id="g433">
    <path d="M 57.990000,58.000000 L 54.010000,58.000000 C ...." id="path431" />
  </g>
</g>

What should have happened?

  • The path is in the same container than the background rectangle ;
  • The styling is applied directly to the path ;
  • Path and rectangle dimensions are integer values: a factor 100 is applied and taken in account on the scale factor of the main group.
<g inkscape:label="QR Code: This is a test" transform="matrix(0.0026458,0,0,0.0026458,178,270)" id="g1212">
  <rect x="0" y="0" width="6600" height="6600" style="stroke:none;fill:white" id="rect429" />
  <path style="stroke:none;fill:black" d="M 5800,5800 L 5400,5800 C ...." id="path431" />
</g>

Sample attachments:

No need

Version info

Inkscape 1.2.1 (9c6d41e410, 2022-07-14)

    GLib version:     2.72.2
    GTK version:      3.24.34
    glibmm version:   2.66.4
    gtkmm version:    3.24.6
    libxml2 version:  2.9.14
    libxslt version:  1.1.35
    Cairo version:    1.17.6
    Pango version:    1.50.7
    HarfBuzz version: 4.4.1

    OS version:       Windows 10 21H2
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information