Introduce option to remove SVG background completely
This Merge Request introduces an option --svg-no-background which causes the SVG background rectangle to be dropped. This can help when importing the resulting SVG into other software (like OpenSCAD) where the (invisible) background is then still recognised as an object.
I think some other softwares (e.g. Inkscape) unlike OpenSCAD might need a rect object as background in order to keep its image size with background while importing.
No problem here with current Inkscape 1.1
I you remove the background rect with Inkscape manually, it results in the same SVG file as not creating the background in the first place.
I've tested with Inkscape 1.0.1 (Sorry, I don't have 1.1 yet).
- Make an SVG file by qrencode.
- Remove a background
rectfrom the SVG file by a text editor. (I think this is the expected behavior in this pull request). - Open a new document with Inkscape 1.0.1 (Win10)
- Import the edited SVG file into the Inkscape document (Include SVG image as editable object(s) in the current file).
- Save the Inkscape document.
- There is no
rectobject corresponding to the (removed) backgroundrect.
That is, we lose the size of the QR code image with its background as an unexpected side effect.
There might be some other softwares like this...
I'm not a maintainer, but in my opinion, it would be sufficient to implement an explicit command line option to output no background rect for the purpose of this pull request...
@lemniscati I changed the Merge Request to introduce an option --svg-no-background. It is probably better this way as my original proposal might break backwards compatibility.
I agree.