QR Code scaling problems / Crash
Steps to reproduce:
-
Attempt to use QR Code generator under Extensions > Render > Barcode / QR Code
-
Set Square size (px): 64.0
-
Use Clone option selecting group g7931
-
Hit Apply
-
Use Clone option selecting group g7931-8
-
Hit Apply
-
Note massive scaling discrepancy
-
Also sporadically crashes*
What happened?
There appears to be a bug when trying to scale a rectangle to fix the box area for the qrcode samples, even with boxes with near identical sizes
What should have happened?
The intended use likely is to stretch a rectangular bounding box of a selected item to fit into the square bounding box for the QR Code dots. Instead you'll find that one of the results is significantly quashed in one dimension.
Inkscape Version and Operating System:
- Inkscape Version: Inkscape 1.4 (86a8ad7, 2024-10-11)
- Operating System: Windows 10
There appears to be problems trying to make use of symbols, unless the selected object is exactly right, the objects are not stretched to fit. Usage can also crash inkscape.
The likely relevant code is render_symbol function in render_barcode_qrcode.py
def render_symbol(self):
symbol = self.svg.getElementById(self.options.symbolid)
if symbol is None:
raise inkex.AbortExtension(
_("Can't find symbol {}").format(self.options.symbolid)
)
bbox = symbol.path.bounding_box()
transform = inkex.Transform(
scale=(
float(self.boxsize) / bbox.width,
float(self.boxsize) / bbox.height,
)
)