Skip to content

Conversation

@cdmurph32
Copy link
Collaborator

Changes in this pull request

Adding the manifest url to large XMP segments could cause the XMP data
to exceed the limit of 65503 bytes.

There were 3 causes of this issue:

  1. Extra whitespace from formatting. The quick_xml writer shiftwidth
    could be much larger than that of the original. Potentially adding
    several KB of whitespace.
  2. Manifest url added multiple times. The manifest url was added to
    multiple keys within the XMP data.
  3. Lack of padding awareness. According to the spec, XMP segments should
    have 2KB to 4KB of padding. The padding should be adjusted to keep
    the XMP data length the same with the addition of the remote manifest
    url. This is important for data hashes as it keeps the offsets of the
    JPEG metadata the same.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

Adding the manifest url to large XMP segments could cause the XMP data
to exceed the limit of 65503 bytes.

There were 3 causes of this issue:
1. Extra whitespace from formatting. The quick_xml writer shiftwidth
   could be much larger than that of the original. Potentially adding
   several KB of whitespace.
2. Manifest url added multiple times. The manifest url was added to
   multiple keys within the XMP data.
3. Lack of padding awareness. According to the spec, XMP segments should
   have 2KB to 4KB of padding. The padding should be adjusted to keep
   the XMP data length the same with the addition of the remote manifest
   url. This is important for data hashes as it keeps the offsets of the
   JPEG metadata the same.
@codecov
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.59%. Comparing base (768ade1) to head (95b1373).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sdk/src/utils/xmp_inmemory_utils.rs 97.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1156      +/-   ##
==========================================
+ Coverage   79.56%   79.59%   +0.02%     
==========================================
  Files         147      147              
  Lines       40541    40582      +41     
==========================================
+ Hits        32258    32301      +43     
+ Misses       8283     8281       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdmurph32 cdmurph32 changed the title Fix xmp jpeg write Fix: xmp jpeg write Jun 16, 2025
@cdmurph32 cdmurph32 changed the title Fix: xmp jpeg write fix: xmp jpeg write Jun 16, 2025
@mauricefisher64 mauricefisher64 requested a review from gpeacock June 17, 2025 14:02
@cdmurph32 cdmurph32 merged commit c40c988 into main Jul 7, 2025
38 checks passed
@cdmurph32 cdmurph32 deleted the fix_xmp_jpeg_write branch July 7, 2025 21:35
@caiopensrc caiopensrc mentioned this pull request Jul 7, 2025
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.

4 participants