|
|
@@ -664,7 +664,8 @@ class OCRLayoutManager:
|
|
|
sizey=image.height,
|
|
|
sizing="stretch",
|
|
|
opacity=1.0,
|
|
|
- layer="below"
|
|
|
+ layer="below",
|
|
|
+ yanchor="top" # 确保图片顶部对齐
|
|
|
)
|
|
|
)
|
|
|
|
|
|
@@ -709,8 +710,8 @@ class OCRLayoutManager:
|
|
|
)
|
|
|
|
|
|
# 修复:优化显示尺寸计算
|
|
|
- max_display_width = 1200
|
|
|
- max_display_height = 1200
|
|
|
+ max_display_width = 1500
|
|
|
+ max_display_height = 1000
|
|
|
|
|
|
# 计算合适的显示尺寸,保持宽高比
|
|
|
aspect_ratio = image.width / image.height
|
|
|
@@ -725,8 +726,8 @@ class OCRLayoutManager:
|
|
|
display_width = int(display_height * aspect_ratio)
|
|
|
|
|
|
# 确保不会太小
|
|
|
- display_width = max(display_width, 400)
|
|
|
- display_height = max(display_height, 300)
|
|
|
+ display_width = max(display_width, 800)
|
|
|
+ display_height = max(display_height, 600)
|
|
|
else:
|
|
|
# 固定尺寸模式,但仍要考虑容器限制
|
|
|
display_width = min(image.width, max_display_width)
|