Fix svg drawing generation

This commit is contained in:
Ruben van de Ven 2023-02-09 14:00:21 +01:00
parent a1bc3acd5d
commit 58e869c969

View file

@ -504,7 +504,7 @@ class DrawingHandler(tornado.web.RequestHandler):
if extension == "svg": if extension == "svg":
self.set_header("Content-Type", "image/svg+xml") self.set_header("Content-Type", "image/svg+xml")
self.write(drawing.get_animation().get_as_svg()) self.write(drawing.get_animation().get_as_svg())
if extension == "png": elif extension == "png":
self.set_header("Content-Type", "image/png") self.set_header("Content-Type", "image/png")
svgstring =drawing.get_animation().get_as_svg() svgstring =drawing.get_animation().get_as_svg()
self.write(cairosvg.svg2png(bytestring = svgstring)) self.write(cairosvg.svg2png(bytestring = svgstring))