Use full-bleed photos with a single-line bottom watermark
This commit is contained in:
@@ -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)),
|
||||
)
|
||||
Reference in New Issue
Block a user