1
0
Files
PPTX/tests/e2e/test_fit_modes.yaml
lanyuanxiaoyao 19d6661381 feat: 添加图片适配模式支持
- 支持四种图片适配模式:stretch、contain、cover、center
- 支持背景色填充功能(contain 和 center 模式)
- 支持文档级 DPI 配置(metadata.dpi)
- PPTX 渲染器集成 Pillow 实现高质量图片处理
- HTML 渲染器使用 CSS object-fit 实现相同效果
- 添加完整的单元测试、集成测试和端到端测试
- 更新 README 文档和架构文档
- 模块化设计:utils/image_utils.py 图片处理工具模块
- 添加图片配置验证器:validators/image_config.py
- 向后兼容:未指定 fit 时默认使用 stretch 模式
2026-03-04 10:29:21 +08:00

41 lines
927 B
YAML

metadata:
title: "图片适配模式端到端测试"
size: "16:9"
dpi: 96
slides:
# 测试所有 fit 模式
- elements:
- type: text
content: "图片适配模式测试"
box: [1, 0.5, 8, 0.8]
font:
size: 32
bold: true
align: center
# stretch 模式(默认)
- type: image
src: "../fixtures/images/test_image.png"
box: [0.5, 1.5, 2, 1.5]
# contain 模式
- type: image
src: "../fixtures/images/test_image.png"
box: [3, 1.5, 2, 1.5]
fit: contain
background: "#f0f0f0"
# cover 模式
- type: image
src: "../fixtures/images/test_image.png"
box: [5.5, 1.5, 2, 1.5]
fit: cover
# center 模式
- type: image
src: "../fixtures/images/test_image.png"
box: [8, 1.5, 2, 1.5]
fit: center
background: "#ffffff"