Get subtify logo from assets folder
Browse files
app.py
CHANGED
@@ -37,12 +37,18 @@ YOUTUBE = "youtube"
|
|
37 |
TWITCH = "twitch"
|
38 |
ERROR = "error"
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
BACKGROUND_COLOR = "#0b0f19"
|
48 |
BUTTON_COLOR = "#47515f"
|
@@ -174,7 +180,7 @@ html_social_media = f'''
|
|
174 |
|
175 |
html_subtify_logo = f"""
|
176 |
<div style="display: flex; justify-content: center; align-items: center;">
|
177 |
-
<img src='
|
178 |
</div>
|
179 |
"""
|
180 |
|
|
|
37 |
TWITCH = "twitch"
|
38 |
ERROR = "error"
|
39 |
|
40 |
+
try:
|
41 |
+
# Asumiendo que tienes la imagen en una carpeta 'assets' de tu proyecto
|
42 |
+
subtify_logo = Image.open("assets/subtify_logo-scaled.webp")
|
43 |
+
subtify_logo_width, subtify_logo_height = subtify_logo.size
|
44 |
+
factor = 4
|
45 |
+
new_width = subtify_logo_width // factor
|
46 |
+
new_height = subtify_logo_height // factor
|
47 |
+
except Exception as e:
|
48 |
+
print(f"No se pudo cargar la imagen: {e}")
|
49 |
+
# Valores predeterminados en caso de error
|
50 |
+
new_width = 200
|
51 |
+
new_height = 100
|
52 |
|
53 |
BACKGROUND_COLOR = "#0b0f19"
|
54 |
BUTTON_COLOR = "#47515f"
|
|
|
180 |
|
181 |
html_subtify_logo = f"""
|
182 |
<div style="display: flex; justify-content: center; align-items: center;">
|
183 |
+
<img src='assets/subtify_logo-scaled.webp' width={new_width}px height={new_height}px >
|
184 |
</div>
|
185 |
"""
|
186 |
|