修改了默认配置
This commit is contained in:
parent
b554e13025
commit
c077673eb4
@ -400,7 +400,7 @@ class PosterGenerator:
|
||||
valid_additional_texts.append(item)
|
||||
elif isinstance(item, str) and item:
|
||||
# 如果是字符串,转换为字典格式
|
||||
valid_additional_texts.append({"text": item, "position": "bottom", "size_factor": 0.5})
|
||||
valid_additional_texts.append({"text": item, "position": "middle", "size_factor": 0.5})
|
||||
|
||||
print(f"有效额外文本项: {len(valid_additional_texts)}")
|
||||
|
||||
@ -470,7 +470,7 @@ class PosterGenerator:
|
||||
if position == 'top':
|
||||
line_y = int(height * 0.05) + (i * line_height)
|
||||
elif position == 'middle':
|
||||
line_y = int(height * 0.45) + (i * line_height)
|
||||
line_y = int(height * 0.4) + (i * line_height)
|
||||
else: # position == 'bottom' 或其他
|
||||
# 在底部区域,使用更大的垂直间距,比如整个海报高度的65%到85%
|
||||
bottom_start = int(height * 0.65)
|
||||
|
||||
@ -655,11 +655,11 @@ def generate_posters_for_topic(topic_item: dict,
|
||||
if texts:
|
||||
# 确保文本不为空
|
||||
if texts[0]:
|
||||
text_data["additional_texts"].append({"text": texts[0], "position": "bottom", "size_factor": 0.5})
|
||||
text_data["additional_texts"].append({"text": texts[0], "position": "middle", "size_factor": 0.8})
|
||||
|
||||
# 添加第二个文本(如果有并且满足随机条件)
|
||||
if len(texts) > 1 and texts[1] and random.random() < text_possibility:
|
||||
text_data["additional_texts"].append({"text": texts[1], "position": "bottom", "size_factor": 0.5})
|
||||
text_data["additional_texts"].append({"text": texts[1], "position": "middle", "size_factor": 0.8})
|
||||
|
||||
# 打印要发送的文本数据
|
||||
logging.info(f"文本数据: {text_data}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user