Use full-bleed photos with a single-line bottom watermark

This commit is contained in:
Pigway
2026-10-06 10:03:59 +08:00
parent 60f42fb58c
commit 559ee767e2
6 changed files with 156 additions and 34 deletions
@@ -0,0 +1,25 @@
"""Layout-only extension point for a future AI layout provider."""
from dataclasses import dataclass
from typing import Protocol
@dataclass(frozen=True)
class PhotoLayout:
footer_height: int
font_size: int
margin: int
class PhotoLayoutProvider(Protocol):
def layout(self, size: tuple[int, int], caption: dict[str, str]) -> PhotoLayout: ...
class WatermarkLayout:
def layout(self, size: tuple[int, int], caption: dict[str, str]) -> PhotoLayout:
width, height = size
return PhotoLayout(
footer_height=max(60, round(min(width, height) * 0.06)),
font_size=max(24, round(min(width, height) * 0.03)),
margin=max(24, round(width * 0.025)),
)