Skip to content

fix(docx): render floating picture rotation - #1402

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1366-docx-picture-rotation
Aug 30, 2026
Merged

fix(docx): render floating picture rotation#1402
developer0hye merged 1 commit into
mainfrom
fix/issue-1366-docx-picture-rotation

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

Related issue

Related: #1366

Testing

  • cargo test -p office2pdf --lib parser::docx::tests::image_tests::docx_floating_picture_rotation_reaches_ir_and_typst -- --exact --nocapture
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • OFFICE2PDF_VALIDATE_PDF=1 cargo test --workspace
  • cargo check --target wasm32-unknown-unknown -p office2pdf
  • cargo check --target wasm32-unknown-unknown -p office2pdf --features wasm
  • cargo check --target wasm32-unknown-unknown -p office2pdf --features wasm-cjk-font
  • wasm-pack build crates/office2pdf --target web --features wasm
  • wasm-pack test --node --features wasm (10 passed)
  • wasm-pack build crates/office2pdf --target web --features wasm-cjk-font
  • wasm-pack test --node --features wasm-cjk-font (11 passed)
  • python3 scripts/compare_render.py --page 1 --dpi 150 --artifacts-dir /tmp/office2pdf-issue-1366.HDrLbu/after-pivot-audit --audit /tmp/office2pdf-issue-1366.HDrLbu/gt.pdf /tmp/office2pdf-issue-1366.HDrLbu/after-pivot.pdf (expected nonzero; remaining clusters dispositioned below)
  • python3 scripts/compare_layout.py --audit /tmp/office2pdf-issue-1366.HDrLbu/gt.pdf /tmp/office2pdf-issue-1366.HDrLbu/after-pivot.pdf (expected nonzero; every large text-instance shift dispositioned below)
  • Local validate_evidence check from scripts/check_visual_pr.py
  • Documentation freshness review: PASS

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason:

Visual audit

Visual comparison

GT Before After
GT Before After

At 150 DPI, the 5% fuzz absolute-error count decreased from 1,539,170 before the fix to 1,357,860 after it. The output retains the same two Letter pages as the GT.

Required inspection

  • Rendered all evidence at 150 DPI or higher
  • Stored progressive JPEG quality 86 assets with metadata stripped
  • Used Codex/Claude vision to inspect the full GT/output pages, diff, and matched crops
  • Inspected matched region crops at full resolution
  • Ran compare_layout.py --audit and dispositioned every large text-instance shift
  • Ran the 5% fuzz pixel-difference sweep
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

Deviation audit

Check Result
Page count/order Matches GT: two Letter pages in the same order
Element presence Remaining: #1363 tracks custom paths and dot fields; #1368 tracks the RSVP line on the wrong page
Position/size Remaining: #1365 tracks grouped WPG placement, #1368 the RSVP page placement, and #1370 the footer baseline; the photo keeps its pre-fix centre and matches the GT edge length within 0.05pt
Rotation/flip Fixed: the photo now follows the GT angle and centre pivot; WPG child rotations/flips remain tracked in #1365
Fill Remaining: #1364 tracks gradients and #1367 tracks theme aliases and alpha
Stroke/border Remaining: #1363 and #1365 track custom and transformed outlines; the photo declares no border, and no new dash-style deviation was observed
Shape outline geometry Remaining: #1363 tracks custom paths and #1365 tracks transformed preset outlines
Text content Remaining: #1368 tracks the RSVP text on page 1 instead of page 2; the text itself survives
Font family/weight/style Matches GT: heavy title, regular serif subtitle, and bold gate-line emphasis are preserved; host font substitution explains family raster differences
Text color Remaining: #1367 tracks unresolved tx/bg aliases; no photo color transform changed
Alignment Remaining: #1365 tracks grouped-text shifts, #1368 the RSVP shift, and #1370 the footer text-box shift
Line/paragraph spacing No deviation observed: the reported pitch deltas come from independently positioned WPG text tracked in #1365
Clipping/overflow No deviation observed: the rotated photo remains clipped to its drawing frame without new overflow; RSVP pagination remains tracked in #1368

The page-1 hairline inventory contains the thin white circle and small triangle outlines; they remain present, with their transform deviations tracked in #1365. The dot fields are filled custom geometry rather than dashed strokes and remain tracked in #1363. The photo region contains no hairline, border, bold, italic, or underlined element.

Checklist

  • Commits include a Signed-off-by line
  • PR scope contains one root cause
  • Remaining visual deviations each reference an open issue

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 0644448 into main Aug 30, 2026
18 checks passed
@developer0hye
developer0hye deleted the fix/issue-1366-docx-picture-rotation branch August 30, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant