Support reading and writing XML and XMP metadata in JPEG 2000 #10550
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 142 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.297
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10550"
general
weight: 0.35
radarhere
<!-- Describe the purpose of this PR -->
Resolves #3048.
Changes:
1.
src/PIL/Jpeg2KImagePlugin.py:- Reading: Replaced the rigid
read(12)check afterjp2hwith aBoxReaderloop that scans subsequent top-level boxes. Readsxmlboxes intoself.info["xml"]and recognizes Adobe XMPuuidboxes (be7acfcb-97a9-42e8-9c71-999491e3afac) as well as XML packets containing XMP metadata (self.info["xmp"]).- Writing: Added support for the
xml(orxmp) keyword argument when saving JP2 images. Injectsxmlbox(es) immediately following thejp2hheader box according to ISO/IEC 15444-1 Annex I.2. Tests & Docs:
- Added tests in [Tests/test_file_jpeg2k.py](file:///c:/Users/Vicky%20Patel/Desktop/Open%20Source/Python%20-%20Pillow/Tests/test_file_jpeg2k.py) covering XML metadata roundtripping (bytes and str), multiple XML boxes, XMP metadata, Adobe UUID box parsing, and simultaneous XML + codestream comment preservation.
- Added release note entry in [docs/releasenotes/13.1.0.rst](file:///c:/Users/Vicky%20Patel/Desktop/Open%20Source/Python%20-%20Pillow/docs/releasenotes/13.1.0.rst).