1

Ajoute les noms dans les collages globaux filtrés

This commit is contained in:
2025-12-03 23:41:12 +01:00
parent 316e1d89a7
commit f25d752e9c
3 changed files with 38 additions and 5 deletions

View File

@@ -125,7 +125,8 @@ def test_build_character_sets_and_collages(tmp_path: Path) -> None:
)
assert len(head_collages) == 1
bob_head = Image.open(heads_destination / f"{sanitize_name('Bob')}.png")
assert bob_head.getpixel((3, 8)) == (220, 220, 220)
assert bob_head.size == (34, 24)
assert any(pixel == (220, 220, 220) for pixel in bob_head.getdata())
def test_stack_collages_with_filter(tmp_path: Path) -> None:
@@ -138,8 +139,16 @@ def test_stack_collages_with_filter(tmp_path: Path) -> None:
Image.new("RGB", (14, 8), (120, 120, 120)).save(img2)
destination = tmp_path / "stacked.png"
stack_collages(source_dir, destination, spacing=2, allowed_stems={"Bob"})
stack_collages(
source_dir,
destination,
spacing=2,
allowed_stems={"Bob"},
name_panel_width=4,
labels_by_stem={"Bob": "Bob"},
)
result = Image.open(destination)
assert result.size == (14, 8)
assert result.getpixel((0, 0)) == (120, 120, 120)
assert result.size == (18, 8)
assert result.getpixel((0, 0)) == (255, 255, 255)
assert result.getpixel((6, 0)) == (120, 120, 120)