code quality improvement
This commit is contained in:
@@ -68,7 +68,6 @@ def build_text_only(texts: List[Text], debug: bool = False) -> Image.Image:
|
||||
range_factor = heights[i] / max_height
|
||||
start = sum(heights[:i]) / max_height
|
||||
text.y_range = (start + text.y_range[0] * range_factor, start + text.y_range[1] * range_factor)
|
||||
pass
|
||||
txt_img = Image.new('RGBA', (TEXT_IMAGE_WIDTH, max_height), (255, 255, 255))
|
||||
return apply_texts(txt_img, texts, debug=debug)
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ def load_item(i: int, item: dict):
|
||||
meme.texts_len = current_text - 1
|
||||
except TypeError as e:
|
||||
logger.warning(f"Item '{item_id}'({i + 1}) / Text {j + 1}: {e}")
|
||||
for text in meme.texts:
|
||||
text.update(meme.text_base)
|
||||
for text in meme.texts:
|
||||
text.update(meme.text_base)
|
||||
else:
|
||||
DATA[item_id] = meme
|
||||
if not meme.abstract:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import Optional, Tuple, List
|
||||
import re
|
||||
from PIL import Image
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
Reference in New Issue
Block a user