Remove background from SVGBob file.

This commit is contained in:
Gijs 2024-03-28 14:33:32 +01:00
parent ee24f4d84f
commit 3719c7a1ec

4
app.py
View File

@ -247,6 +247,10 @@ def hpgl (id):
# to SVG # to SVG
svg = ascii2svg(ascii_input, params['weight']) svg = ascii2svg(ascii_input, params['weight'])
svg = re.sub(r'\<rect class="backdrop" x="\d+" y="\d+" width="\d+" height="\d+">\<\/rect\>', '', svg, flags=re.M)
#print(svg)
# store as a temporary file # store as a temporary file
(svg_file, svg_path) = tempfile.mkstemp('.svg') (svg_file, svg_path) = tempfile.mkstemp('.svg')