Kei API JSON 파싱 실패 수정 + 이미지 경로 재탐색

1. kei_client.py _parse_json(): Kei가 마크다운 리스트 접두사(- )를 붙여
   JSON 응답하는 경우 전처리하여 파싱. 원본 + 클린 버전 둘 다 시도.
2. image_utils.py: base_path와 상대경로가 이중으로 붙는 경우
   파일명으로 rglob 재탐색하여 실제 파일 위치 찾기.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 19:01:50 +09:00
parent 5052a9f1dc
commit fb67f221f4
2 changed files with 41 additions and 13 deletions

View File

@@ -50,6 +50,15 @@ def get_image_sizes(content: str, base_path: str) -> list[dict[str, Any]]:
if abs_path.suffix.lower() not in IMAGE_EXTENSIONS:
continue
# 경로가 이중으로 붙는 경우 방어 (base가 이미 하위 폴더를 포함할 때)
if not abs_path.exists():
# rel_path에서 파일명만 추출하여 base 하위에서 재검색
filename = Path(rel_path).name
found = list(base.rglob(filename))
if found:
abs_path = found[0]
logger.info(f"이미지 경로 재탐색 성공: {filename}{abs_path}")
if not abs_path.exists():
logger.warning(f"이미지 파일 미발견: {abs_path}")
images.append({