Skip to content

fix: preserve parsed picture rotation - #4

Merged
developer0hye merged 1 commit into
fix/parse-tolerancefrom
fix/parse-tolerance-picture-rotation
Aug 30, 2026
Merged

fix: preserve parsed picture rotation#4
developer0hye merged 1 commit into
fix/parse-tolerancefrom
fix/parse-tolerance-picture-rotation

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

  • parse a:xfrm rot while reading DrawingML pictures
  • normalize the OOXML angle and round it to the nearest whole degree supported by Pic.rot
  • add regression coverage for 20933656 -> 349

This compatible backport lets office2pdf preserve the floating picture angle while upstream PR bokuweb#920 is pending.

Validation

  • red regression test before implementation: left: 0, right: 349
  • targeted regression test passed on Rust 1.81
  • cargo test -p docx-rs --lib -- --test-threads=1 (276 passed)
  • changed file passed rustfmt +1.81 --edition 2021 --check
  • all-target/all-feature Clippy passed after allowing seven pre-existing branch-wide lints
  • git diff --check

Existing branch baselines

  • cargo fmt --all -- --check reports unrelated pre-existing formatting in fit_text.rs and elements/mod.rs.
  • make test reaches 309 passing unit tests, then 20 existing platform-sensitive snapshot mismatches; generated snapshot changes were discarded.
  • the unmodified make lint reports seven pre-existing warnings outside this change.

Related: developer0hye/office2pdf#1366
Upstream: bokuweb#920

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye

Copy link
Copy Markdown
Owner Author

The branch-specific implementation is validated by both build and Clippy jobs, and the new picture-rotation parser test passes locally on Rust 1.81.

The remaining CI failures reproduce on the unchanged fix/parse-tolerance baseline and are outside this PR:

  • test: existing platform-sensitive snapshots fail first at read_bom, read_bookmark, read_comment, and read_comment_in_delete_in_insert; this change only touches docx-core/src/reader/pic.rs.
  • build-wasm: the current toolchain reports TS5108 (moduleResolution=node10 removed) and TS5011 (rootDir must be explicit) from the existing tsconfig.node.json.

Upstream bokuweb#920 runs the same parser change against current upstream and all four CI jobs pass.

@developer0hye
developer0hye merged commit 3e0d273 into fix/parse-tolerance Aug 30, 2026
5 of 9 checks passed
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