gojiteji commited on
Commit
0712f50
1 Parent(s): 3a8a569

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -170,20 +170,14 @@ def generate(logo=None, Vtubername=""):
170
  caption = result_image
171
 
172
  def resize_caption_to_logo(logo, caption):
173
- logo_width = logo.width
174
- target_caption_width = int(logo_width)
175
- logo_height = logo.height
176
- target_caption_height = int(logo_height)
177
-
178
- if caption.width > target_caption_width:
179
- aspect_ratio = caption.width / target_caption_width
180
- new_width = int(caption.width * aspect_ratio * 0.4)
181
- new_height = int(caption.height * aspect_ratio * 0.4)
182
  print("resizing")
183
- resized_caption = caption.resize((new_width, new_height), Image.ANTIALIAS)
184
  return resized_caption
185
  else:
186
  return caption
 
187
  caption = resize_caption_to_logo(logo, caption)
188
 
189
 
 
170
  caption = result_image
171
 
172
  def resize_caption_to_logo(logo, caption):
173
+ if caption.width > logo.width:
174
+ scaler = 3
175
+ resized_caption = caption.resize((int(logo.width*scaler), int(scaler*caption.height * logo.width / caption.width )))
 
 
 
 
 
 
176
  print("resizing")
 
177
  return resized_caption
178
  else:
179
  return caption
180
+
181
  caption = resize_caption_to_logo(logo, caption)
182
 
183