调整图片尺寸
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user