Improve board sizing and page packing

This commit is contained in:
ajp_anton
2026-05-31 19:57:08 +00:00
parent 4f9eb9ec60
commit 774de1c4f5
5 changed files with 766 additions and 193 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ from pathlib import Path
from PIL import Image, ImageChops, ImageDraw
from .assets import cover_resize, find_art_for_json, hex_color, load_json, load_rgb, meta_unit_scale, render_work_scale, safe_name, save_temp_png
from .boards import board_target_mm
from .boards import board_target_mm, crop_board_bleed
from .settings import (
BASE_CARD_SIZE,
BASEMENT_SINGLE_STARTER_COLOR,
@@ -652,7 +652,7 @@ def render_sources(config: BuildConfig) -> tuple[list[PrintItem], list[PrintItem
for board_path in sorted(board_dir.glob("*-jumbo-front.png")):
target_mm = board_target_mm(board_path, config)
target_px = (mm_to_px(target_mm[0], config.dpi), mm_to_px(target_mm[1], config.dpi))
image = load_rgb(board_path).convert("RGB")
image = crop_board_bleed(load_rgb(board_path).convert("RGB"))
adjusted = apply_print_adjustments(image, config, target_px, "board")
out = RENDER_DIR / "boards" / board_path.name
out.parent.mkdir(parents=True, exist_ok=True)