Spaces:
Runtime error
Runtime error
Fix project config color, shorten output png
Browse files
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
title: Test Space
|
3 |
emoji: π
|
4 |
-
colorFrom:
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
python_version: 3.9.10
|
|
|
1 |
---
|
2 |
title: Test Space
|
3 |
emoji: π
|
4 |
+
colorFrom: gray
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
python_version: 3.9.10
|
app.py
CHANGED
@@ -243,7 +243,6 @@ def format_monster_card(monster_text, image_data):
|
|
243 |
card = card.replace('Hit:', '<i>Hit:</i>')
|
244 |
|
245 |
print('FORMATTING MONSTER TEXT COMPLETE')
|
246 |
-
print(card)
|
247 |
return card
|
248 |
|
249 |
|
@@ -261,7 +260,7 @@ hti = Html2Image(output_path='rendered_cards')
|
|
261 |
|
262 |
def html_to_png(html):
|
263 |
print('CONVERTING HTML CARD TO PNG IMAGE')
|
264 |
-
paths = hti.screenshot(html_str=html, css_file="monstermaker.css", save_as="test.png", size=(400,
|
265 |
path = paths[0]
|
266 |
print('OPENING IMAGE FROM FILE')
|
267 |
img = Image.open(path).convert("RGB")
|
|
|
243 |
card = card.replace('Hit:', '<i>Hit:</i>')
|
244 |
|
245 |
print('FORMATTING MONSTER TEXT COMPLETE')
|
|
|
246 |
return card
|
247 |
|
248 |
|
|
|
260 |
|
261 |
def html_to_png(html):
|
262 |
print('CONVERTING HTML CARD TO PNG IMAGE')
|
263 |
+
paths = hti.screenshot(html_str=html, css_file="monstermaker.css", save_as="test.png", size=(400, 1000))
|
264 |
path = paths[0]
|
265 |
print('OPENING IMAGE FROM FILE')
|
266 |
img = Image.open(path).convert("RGB")
|