调整图片尺寸

This commit is contained in:
liuwei
2025-03-17 09:10:34 +08:00
parent 94e3d532e6
commit 8db22b6ab5
2 changed files with 2 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ def md_str_to_html(md_content, output_html):
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
padding: 20px;
line-height: 1.6;
max-width: 800px;
max-width: 700px;
margin: 0 auto;
}
pre, code {
@@ -76,7 +76,7 @@ def html_to_image(html_file, output_image):
page.goto(f'file://{os.path.abspath(html_file)}')
# 设置 viewport可选根据需要调整
page.set_viewport_size({"width": 1200, "height": 800})
page.set_viewport_size({"width": 900, "height": 700})
# 截图
page.screenshot(path=output_image, full_page=True)

View File

@@ -1,8 +1,5 @@
import requests
import json
import os
import uuid
from datetime import datetime
from message_summary.compress_chat_data import compress_chat_data
from message_summary.markdown_to_image import convert_md_str_to_image