From 0bddc5c6072da0de601bd75e79b1057a3384f67c Mon Sep 17 00:00:00 2001 From: gahusb Date: Mon, 18 May 2026 00:10:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(insta-lab):=20design=5Fimporter=20image=20?= =?UTF-8?q?dimension=20=EA=B2=80=EC=A6=9D=20(1080x1350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- insta-lab/app/design_importer.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/insta-lab/app/design_importer.py b/insta-lab/app/design_importer.py index 0ef8b9f..bf75b3f 100644 --- a/insta-lab/app/design_importer.py +++ b/insta-lab/app/design_importer.py @@ -12,11 +12,17 @@ from PIL import Image logger = logging.getLogger(__name__) +__all__ = [ + "_resolve_page_mapping", + "_validate_images", +] + # 페이지 1 (커버) 키워드 우선순위 — 먼저 매치된 키워드를 가진 첫 파일만 page 1 _COVER_KEYWORDS = ("cover", "start", "intro") # 페이지 10 (CTA) 키워드 우선순위 _CTA_KEYWORDS = ("cta", "outro", "finish", "end") +# 인스타그램 카드 규격 (세로형 4:5 비율) _EXPECTED_SIZE = (1080, 1350) @@ -87,7 +93,10 @@ def _build_mapping(pngs: List[str]) -> Dict[str, int]: def _validate_images(pages_dir: Path) -> None: - """모든 PNG가 정확히 1080×1350인지 검증. 다르면 ValueError.""" + """모든 PNG가 정확히 1080×1350인지 검증. 다르면 ValueError. + + early-exit 하지 않고 전체 파일을 검사한 뒤 한 메시지에 모아 raise. + """ pages_dir = Path(pages_dir) bad = [] for png_path in sorted(pages_dir.glob("*.png")):