Spaces:
Runtime error
Runtime error
Lengthen output png, add additional formatting
Browse files
app.py
CHANGED
@@ -240,6 +240,7 @@ def format_monster_card(monster_text, image_data):
|
|
240 |
|
241 |
card = card.replace('Melee Weapon Attack:', '<i>Melee Weapon Attack:</i>')
|
242 |
card = card.replace('Ranged Weapon Attack:', '<i>Ranged Weapon Attack:</i>')
|
|
|
243 |
card = card.replace('Hit:', '<i>Hit:</i>')
|
244 |
|
245 |
print('FORMATTING MONSTER TEXT COMPLETE')
|
@@ -260,7 +261,7 @@ hti = Html2Image(output_path='rendered_cards')
|
|
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,
|
264 |
path = paths[0]
|
265 |
print('OPENING IMAGE FROM FILE')
|
266 |
img = Image.open(path).convert("RGB")
|
|
|
240 |
|
241 |
card = card.replace('Melee Weapon Attack:', '<i>Melee Weapon Attack:</i>')
|
242 |
card = card.replace('Ranged Weapon Attack:', '<i>Ranged Weapon Attack:</i>')
|
243 |
+
card = card.replace('Melee or Ranged Weapon Attack:', '<i>Melee or Ranged Weapon Attack:</i>')
|
244 |
card = card.replace('Hit:', '<i>Hit:</i>')
|
245 |
|
246 |
print('FORMATTING MONSTER TEXT COMPLETE')
|
|
|
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, 1200))
|
265 |
path = paths[0]
|
266 |
print('OPENING IMAGE FROM FILE')
|
267 |
img = Image.open(path).convert("RGB")
|