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
+4 -4
View File
@@ -46,7 +46,7 @@ def test_child_folder_inherits_date_and_location():
@pytest.mark.parametrize("profile", ["color", "grayscale"])
def test_native_caption_layout_has_three_separate_lines(service, profile):
def test_native_caption_layout_has_single_watermark_line(service, profile):
out = BytesIO()
Image.new("RGB", (1600, 900), "blue").save(out, "JPEG")
result = render_captioned_photo(
@@ -57,9 +57,9 @@ def test_native_caption_layout_has_three_separate_lines(service, profile):
)
with Image.open(BytesIO(result)) as image:
assert image.size == (1200, 1600)
for y in [1320, 1410, 1480]:
darkest = image.crop((50, y, 1150, y + 65)).convert("L").getextrema()[0]
assert darkest < 50, "Caption row is missing"
assert image.crop((30, 1528, 1170, 1600)).convert("L").getextrema()[0] < 50
assert image.getpixel((20, 1500))[0] < 230
assert image.getpixel((20, 1590))[0] > 240
pixel = image.getpixel((600, 640))
assert (
len(set(pixel)) <= 2