Omnibus commited on
Commit
dc480ec
·
verified ·
1 Parent(s): d5b923a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -430,11 +430,12 @@ def create_image(url):
430
  print(url)
431
  with open("tmp.svg","w") as svg:
432
  svg.write(url)
433
- #with open("tmp.svg", "rb") as f:
434
- # encoded_image = base64.b64encode(f.read())
435
- bytestring=open('tmp.svg').read().encode('utf-8')
 
436
  with open("image.png","wb") as file:
437
- file.write(eval(bytestring))
438
  #output = cairosvg.svg2png(
439
  # bytestring=open('tmp.svg').read().encode('utf-8'), write_to="output.png")
440
  return "image.png"
 
430
  print(url)
431
  with open("tmp.svg","w") as svg:
432
  svg.write(url)
433
+
434
+ with open("tmp.svg", "rb") as f:
435
+ encoded_image = base64.b64encode(f.read())
436
+ #bytestring=open('tmp.svg').read().encode('utf-8')
437
  with open("image.png","wb") as file:
438
+ file.write(eval(bytestring))
439
  #output = cairosvg.svg2png(
440
  # bytestring=open('tmp.svg').read().encode('utf-8'), write_to="output.png")
441
  return "image.png"