Spaces:
Paused
Paused
Update app.py
Browse files
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 |
-
|
| 434 |
-
|
| 435 |
-
|
|
|
|
| 436 |
with open("image.png","wb") as file:
|
| 437 |
-
|
| 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"
|