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 -3
View File
@@ -25,7 +25,7 @@ def test_canvas_respects_rotation_and_explicit_direction(rotation, mode):
@pytest.mark.parametrize("profile", ["color", "grayscale"])
def test_landscape_caption_keeps_three_rows(service, profile):
def test_landscape_caption_uses_compact_watermark(service, profile):
out = BytesIO()
Image.new("RGB", (1600, 900), "blue").save(out, "JPEG")
data = render_captioned_photo(
@@ -37,8 +37,9 @@ def test_landscape_caption_keeps_three_rows(service, profile):
)
with Image.open(BytesIO(data)) as image:
assert image.size == (1600, 1200)
for y in [984, 1048, 1100]:
assert image.crop((60, y, 1540, y + 50)).convert("L").getextrema()[0] < 50
assert image.crop((30, 1128, 1570, 1200)).convert("L").getextrema()[0] < 50
assert image.getpixel((20, 1100))[0] < 230
assert image.getpixel((20, 1190))[0] > 240
pixel = image.getpixel((800, 480))
assert (
len(set(pixel)) <= 2