Task #938: 복학원서 JPEG 워터마크 배경 사각형 제거 및 톤 보정#976
Closed
postmelee wants to merge 1 commit into
Closed
Conversation
b8651c9 to
34615a6
Compare
34615a6 to
2a48ed3
Compare
edwardkim
pushed a commit
that referenced
this pull request
May 19, 2026
- cherry-pick 7a1f22f 검증: test 1484 passed, clippy 0, fmt 0, WASM ok - 시각 판정 통과 (복학원서 워터마크) - 톤 매핑 단일 문서 특화 쟁점 → 옵션 A 수용, 후속 일반화 권고 기록 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
pushed a commit
that referenced
this pull request
May 19, 2026
외부 기여 (postmelee). cherry-pick + 검증 통과 + 시각 판정 통과. - SVG/WebCanvas/studio overlay 단일 baked PNG 통일 - image crate jpeg feature (WASM JPEG decode) - test 1484 passed, clippy 0, fmt 0, WASM ok - 톤 매핑 단일 문서 특화 (옵션 A 수용, 후속 일반화 권고) 검토: mydocs/pr/archives/pr_976_review.md / 보고: pr_976_report.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
cherry-pick 으로 origin/devel 에 반영 완료 (merge 커밋 9ccc9e2). 검증: cargo test 1484 passed, clippy 0 warnings, fmt 0 violations, WASM 빌드 성공. 기여 감사합니다. 검토/보고: mydocs/pr/archives/pr_976_review.md, pr_976_report.md |
edwardkim
pushed a commit
that referenced
this pull request
May 19, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 19, 2026
edwardkim
added a commit
that referenced
this pull request
May 19, 2026
…PaintOp::Image @postmelee — 이미지 변환(BMP/PCX→PNG) + 워터마크 JPEG→baked PNG 판정이 5+ renderer 별 사본(svg/canvas/web_canvas/skia/paint/json)에 분산되어 있던 것을 LayerBuilder 단계 단일 image_resolver::resolve_image_payload() 진입점으로 통합. 결과를 ResolvedImagePayload 로 패키지하여 PaintOp::Image.resolved: Option<Box<...>> 옵션 필드에 부착 (schema minor 12→13, 하위호환). 모든 renderer 는 resolved payload 소비만 — 재판정 없음. 옵션 A: 본질 커밋 3aeaa5b cherry-pick (작성자 postmelee 보존, orders/20260520.md --ours 1건 충돌 해소). 검증: cargo test 1307 + cargo test --test issue_938 3건(overlay/svg/PageLayerTree resolved watermark contract) + clippy -D + fmt 0 + WASM 4.83MB. 광범위 sweep 10 fixture (BEFORE devel ↔ AFTER): 복학원서(워터마크), sample16-hwp5/hwp3, hy-001 HWPX/HWP5, exam_kor/math, aift, biz_plan, test-image — **전부 diff=0** (SVG 출력 100% 동일). 광범위 표면(24파일, 7개 renderer 경로)에도 시각 결과 완전 보존 — feedback_image_renderer_ paths_separate 본질적 해소 + 시각 호환성 100% 모범 사례. 작업지시자 시각 판정 생략 통과 (sweep diff=0 정량 입증). PR scope 좁힘: z-order replay 일반화는 #1017로 분리 (PR 본문 명시). @postmelee 후속 #1019 (Task #975 PageBackground fill + RealPic watermark tone) OPEN 시리즈 연속.
This was referenced May 29, 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.
Refs #938
문제
samples/복학원서.hwp의 중앙 JPEG 워터마크가 rhwp SVG / WebCanvas / rhwp-studio overlay 경로에서 큰 회색 사각형 배경처럼 보입니다.원본 JPEG에는 alpha 채널이 없고 near-white 배경 픽셀이 포함되어 있습니다. 기존 렌더러는 이 JPEG 전체에 밝기/대비 보정, opacity, blend 처리를 적용했기 때문에 워터마크 문양뿐 아니라 JPEG 배경 영역까지 함께 보정되어 사각형 흔적이 남았습니다.
원인
한컴 PDF 출력 결과는 JPEG 원본에 SVG/CSS 필터를 실시간 적용한 결과라기보다, 워터마크 톤을 흰 배경 위에 미리 합성한 opaque 이미지에 가깝습니다.
따라서 기존처럼 JPEG 전체를 반투명 필터 이미지로 취급하면 다음 차이가 생깁니다.
수정
워터마크성 JPEG에 한해 한컴 출력에 가까운 opaque PNG로 미리 bake한 뒤, 모든 렌더 경로가 이 baked PNG를 사용하도록 맞췄습니다.
src/renderer/svg.rsPicEffect != RealPic, 밝기/대비 보정값, JPEG MIME/시그니처, near-white 배경 비율을 함께 확인해 워터마크성 JPEG만 감지opacity=0.17을 다시 적용하지 않음src/document_core/queries/rendering.rsbakedWatermark: true추가src/renderer/web_canvas.rsrhwp-studio/src/view/page-renderer.tsbakedWatermarkoverlay는 CSS filter, mix-blend-mode, opacity를 적용하지 않음Cargo.tomlimagecrate feature에jpeg추가tests/issue_938.rs추가tests/issue_514.rs의 JPEG 워터마크 기대값 갱신tests/golden_svg/issue-677/bokhakwonseo-page1.svg갱신시각 비교
아래 이미지는 PR 작성 후 수동 첨부 예정입니다. 한컴 PDF는 CONTRIBUTING 안내에 따라 절대 기준이 아니라 참고 렌더로 사용합니다.
upstream/devel)검증
통과:
cargo test --release --test issue_938 --test issue_514 --test issue_516 --test svg_snapshotcargo check --target wasm32-unknown-unknown --release --libnpm run build(rhwp-studio)git diff --cached --check확인했지만 통과하지 않은 항목:
cargo test --release --librenderer::layout::integration_tests::tests::test_548_cell_inline_shape_first_line_indent_p8cargo clippy --release --lib -- -D warningssrc/diagnostics/hwp5_contract_probe.rs:366clippy::unnecessary_unwrap리뷰 포인트