Repository navigation
feat(picture): adjust a new picture's image and give it a border - #445
Merged
Merged
Conversation
add_picture (on the document and on a paragraph) takes brightness and contrast (-100 to 100), effect (REAL_PIC, GRAY_SCALE or BLACK_WHITE) and alpha (transparency, 0 opaque to 255 not drawn) for hc:img, and line_color / line_width for a solid hp:lineShape border right after the image, where Hancom saves it. Hancom does not draw a value past these bounds as given (a contrast past them turns the colours over, alpha 256 is saved as 0, another effect as REAL_PIC), so one is refused before anything is added (shape-picture-image-value, shape-picture-border-value). The paragraph method moves to oxml/objects.py with the other object helpers; paragraph.py sat at its line cap. Refs #52 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
리뷰 결과: 막을 것은 없습니다. CI가 통과하면 병합합니다. 확인한 것
막지 않는 것(후속으로 좋음)
|
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
바뀐 점
그림을 만들 때(
doc.add_picture,HwpxOxmlParagraph.add_picture) 그림 효과와 테두리를 줄 수 있다. 전에는hc:img에 늘 기본값(밝기·대비 0, 원래 그림, 불투명)을 쓰고 테두리를 쓰지 않았다.brightnesshc:img/@brightcontrasthc:img/@contrasteffecthc:img/@effectREAL_PIC(기본)·GRAY_SCALE·BLACK_WHITE, 대소문자 무관alphahc:img/@alphaline_colorhp:lineShape/@colorhc:img바로 뒤에 둔다(한/글이 저장하는 자리)line_widthhp:lineShape/@width한/글의 동작
PATTERN8x8등)은REAL_PIC으로 저장한다.shape-picture-image-value: 밝기·대비·투명도·효과shape-picture-border-value: 테두리 굵기style-color-invalid코드
oxml/shape_position.py:PICTURE_EFFECTS,validate_picture_image,validate_picture_border.oxml/objects.py:_create_picture_element가 새 인자를 받는다.HwpxOxmlParagraph.add_picture의 구현을 다른 개체 함수들처럼 이 파일로 옮겼다(_paragraph_add_picture, 클래스 속성으로 붙임).paragraph.py는 1,600줄 상한에 닿아 있었다._document/media.py,document.py: 문서 수준add_picture가 같은 인자를 받고, 그림을 더하기 전에 검사한다.errors.py·docs/error-codes.md: 두 오류 코드.docs/support-matrix.md(동봉본 동기화): 그림 행에 효과·테두리 지원과 미지원(그림자 등hp:effects, 자르기, 회전)을 적는다.tests/data/document_facade_surface.json:add_picture서명 갱신.tests/data/error_census.json: 옮긴ValueError하나를oxml/paragraph.py에서oxml/objects.py로 센다.Refs #52
테스트
tests/test_picture_adjustments.py(새 파일):picture_adjusted_and_bordered.hwpx(밝기 20, 대비 -30, 회색조, 투명도 64, 테두리 141)와 같은 값을 쓰고, 테두리가hc:img바로 뒤에 온다.add_picture도 같은 인자를 받고, 효과는 대소문자를 가리지 않는다.🤖 Generated with Claude Code