Maximofn commited on
Commit
66ceab5
·
1 Parent(s): ee3ea7c

Get subtify logo from assets folder

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -37,12 +37,18 @@ YOUTUBE = "youtube"
37
  TWITCH = "twitch"
38
  ERROR = "error"
39
 
40
- urllib.request.urlretrieve('https://pub-fb664c455eca46a2ba762a065ac900f7.r2.dev/subtify_logo-scaled.webp', "subtify_logo.webp")
41
- subtify_logo = Image.open("subtify_logo.webp")
42
- subtify_logo_width, subtify_logo_height = subtify_logo.size
43
- factor = 4
44
- new_width = subtify_logo_width // factor
45
- new_height = subtify_logo_height // factor
 
 
 
 
 
 
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='https://pub-fb664c455eca46a2ba762a065ac900f7.r2.dev/subtify_logo-scaled.webp' width={new_width}px height={new_height}px >
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