LuisBlanche
commited on
Commit
•
3efc309
1
Parent(s):
00aedc8
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from io import BytesIO
|
|
4 |
import mechanicalsoup
|
5 |
import pandas as pd
|
6 |
import requests
|
|
|
7 |
from reportlab.lib import colors
|
8 |
from reportlab.lib.enums import TA_CENTER
|
9 |
from reportlab.lib.pagesizes import A4
|
@@ -306,7 +307,8 @@ def generate_poster(deputy_name, message_1, message_2, vote_list):
|
|
306 |
img_url = pdfposter.img_url
|
307 |
image_response = requests.get(img_url)
|
308 |
image_bytes = BytesIO(image_response.content)
|
309 |
-
|
|
|
310 |
|
311 |
|
312 |
with gr.Blocks(css=css) as demo:
|
|
|
4 |
import mechanicalsoup
|
5 |
import pandas as pd
|
6 |
import requests
|
7 |
+
from PIL import Image as PILImage
|
8 |
from reportlab.lib import colors
|
9 |
from reportlab.lib.enums import TA_CENTER
|
10 |
from reportlab.lib.pagesizes import A4
|
|
|
307 |
img_url = pdfposter.img_url
|
308 |
image_response = requests.get(img_url)
|
309 |
image_bytes = BytesIO(image_response.content)
|
310 |
+
image = PILImage.open(image_bytes)
|
311 |
+
return preview_df, image, filename
|
312 |
|
313 |
|
314 |
with gr.Blocks(css=css) as demo:
|