Skip to content

그룹 resize: 구성원 좌표·행렬을 참조 결과와 비교하고 크기 변경 계약 확정 #311

Description

@airmang

검사한 공개 main은 97670eb2462e106134633acd78a8097d96db0fdd입니다(Python 3.13.13, macOS). 아래 입력은 저장소에 포함되어 있습니다. 추가 참조 검증은 아직 실행하지 않았으며, 관찰 결과를 바탕으로 엔진 지원을 확대하기 위한 과제입니다. core에 외부 실행 환경 의존을 추가하는 제안은 아닙니다.

현재 구조 관찰

외부 입력 tests/fixtures/hwpxlib_corpus/reader_writer__SimpleContainer.hwpx에서 그룹의 orgSz는 17372×3250, 직속 구성원은 pic, pic, line 3개입니다. 그룹의 resize(34744, 6500) 호출 후 그룹 크기는 두 배가 되지만 구성원 3개의 XML은 바이트 동일했습니다.

from hwpx import HwpxDocument
from lxml import etree
with HwpxDocument.open("tests/fixtures/hwpxlib_corpus/reader_writer__SimpleContainer.hwpx") as doc:
    s = next(s for p in doc.paragraphs for s in p.shapes if s.shape_type == "container")
    children = [c for c in s.element if etree.QName(c).localname in {"pic", "line"}]
    before = [etree.tostring(c) for c in children]
    s.resize(34744, 6500)
    print(len(children), before == [etree.tostring(c) for c in children])  # 3 True

처리 요청

같은 원본의 그룹 크기를 바꾼 참조 저장본과 렌더를 확보하고 그룹/구성원의 크기·offset·변환 행렬을 비교해 주세요. 현재 결과의 시각적 오류 여부는 아직 검증하지 않았습니다. 따라서 구성원 XML이 그대로라는 사실만으로 결함이라고 단정하지 않습니다.

한컴의 실제 규칙을 기준으로 현재 resize()가 의도한 표시 크기를 만드는지 판정하고, 필요하다면 그룹 변환을 수정하거나 그룹 전용 API/명확한 거부 계약을 정해 주세요. 그림 2개와 선의 상대 위치·크기를 실제 렌더로 확인하고 회귀검사를 추가하는 것이 완료 기준입니다. 관련 코드: src/hwpx/oxml/objects.py의 resize/_scale_geometry.

검증 원칙

입력 SHA-256·산출물 해시를 기록하고, 페이지 렌더와 한컴 재저장 HWPX를 비교해 회귀 기준으로 남겨 주세요. 캐시가 있는 원본과 편집으로 캐시가 무효화된 경우를 구분하고, 검증 환경에 따라 결과가 다르면 별도 기준으로 기록해야 합니다. 미지원 이유를 제거하거나 파일이 열리는 것만으로 완료하지 않습니다.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions