renderer: HWP 그림 효과(그레이스케일/흑백) SVG 반영#149
Merged
Merged
Conversation
Picture 컨트롤의 image_attr.effect를 지금까지 렌더러가 무시하고 원본 색상으로 출력했다. HWP의 GrayScale/BlackWhite 효과가 반영되지 않는다. - ImageNode에 effect 필드 추가 (기본 RealPic) - Picture 기반 ImageNode 생성 지점(7곳)에서 pic.image_attr.effect 전달 - svg.rs render_image_node에서 효과별 feColorMatrix 필터를 defs에 lazily 등록하고 <g filter="url(...)">로 래핑 - Pattern8x8은 SVG로 표현이 어려워 GrayScale로 폴백 BlackWhite는 luma → discrete threshold (0/1)로 순흑백 변환. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
안녕하세요 @marsimon, 첫 PR 감사합니다! 🎉 코드 변경을 검토했고, 빌드/테스트(785개) 모두 통과했습니다. 로컬에서 렌더링 검증을 하고 싶은데, 그레이스케일/흑백 효과가 적용된 이미지가 포함된 테스트용 HWP 샘플 파일을 함께 올려주실 수 있을까요? 감사합니다! |
복학원서.hwp에는 그림 효과가 GrayScale로 지정된 이미지가 포함되어 있어, 본 PR의 렌더러 수정(ImageEffect → SVG feColorMatrix 필터 래핑)을 회귀 테스트용으로 재현할 수 있다. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
리뷰 감사합니다! 🙏
cargo run --bin rhwp -- export-svg samples/복학원서.hwp출력 SVG에서 |
edwardkim
approved these changes
Apr 15, 2026
Owner
edwardkim
left a comment
There was a problem hiding this comment.
로컬 검증 완료! ✅
cargo test785개 전체 통과samples/복학원서.hwpSVG 내보내기에서 그레이스케일 필터 정상 적용 확인<filter id="rhwp-img-grayscale">정의 생성<g filter="url(#rhwp-img-grayscale)">래핑 확인
samples/pr-149.hwp로 적용 전/후 렌더링 비교 완료
깔끔한 구현 감사합니다! 🎉
edwardkim
added a commit
that referenced
this pull request
Apr 19, 2026
본 v0.5.0 → v0.7.3 (라이브러리) / 0.2.0 (확장) 배포 주기에 머지된 외부 기여자 6명을 README 3개 변경 이력에 추가: - @ahnbu — Ctrl+S file handle (PR #189, 기명시) - @bapdodi — 회전 도형 리사이즈 + Flip (PR #192) - @dreamworker0 — Windows CFB 경로 (PR #152) - @marsimon — HWP 그림 효과 SVG (PR #149) - @postmelee — 썸네일 + options CSP (PR #168) - @seunghan91 — HWPX Serializer + 다수 (PR #170, #161, #163, #153, #154) 각 README 끝에 "기여자 감사" 섹션 추가 — 6명 일괄 인정. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
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.
요약
Picture 컨트롤의
image_attr.effect(GrayScale / BlackWhite / Pattern8x8)가 렌더러에서 무시되어, HWP에서 그레이스케일 효과가 지정된 그림이 SVG 출력에서는 원본 색상 그대로 나옵니다. 본 PR은 해당 효과를 SVG 필터(feColorMatrix)로 반영합니다.변경 내용
ImageNode에effect: ImageEffect필드 추가 (기본RealPic)ImageNode생성 지점 7곳에서pic.image_attr.effect전달picture_footnote.rs(2곳)paragraph_layout.rs(3곳)table_cell_content.rs(1곳)shape_layout.rs(그룹 내 그림, 1곳)svg.rs::render_image_node에서 효과별 SVG 필터를defs에 lazily 등록 후<g filter=\"url(#...)\">로 래핑feComponentTransferdiscrete threshold테스트
cargo test— 785 passed / 0 failedcargo clippy -- -D warnings— 경고 0건<filter id=\"rhwp-img-grayscale\">정의와filter=\"url(#rhwp-img-grayscale)\"참조가 올바르게 삽입됨