feat(图片管理): 添加图片尺寸配置支持

在 config.toml 中新增 image_manager 配置块,包含图片高度和宽度设置
修改 ImageManager 类以使用配置中的尺寸,替代硬编码值
添加 ImageManagerModel 配置模型并集成到全局配置中
This commit is contained in:
2026-02-28 16:17:20 +08:00
parent 58a0c717e3
commit 0bca97424b
5 changed files with 27 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,6 +12,7 @@ from jinja2 import Template
from .browser_manager import browser_manager
from ..utils.logger import logger
from ..utils.singleton import Singleton
from ..config_loader import global_config
class ImageManager(Singleton):
"""
@@ -73,8 +74,8 @@ class ImageManager(Singleton):
return None
try:
width = 1920
height = 1080
width = global_config.image_manager.image_width
height = global_config.image_manager.image_height
await page.set_viewport_size({"width": width, "height": height})
# 加载内容