Skip to content

Add getL and getStreamLength methods to PDInlineImage#709

Merged
MaximPlusov merged 2 commits into
integrationfrom
l-key
Jul 23, 2026
Merged

Add getL and getStreamLength methods to PDInlineImage#709
MaximPlusov merged 2 commits into
integrationfrom
l-key

Conversation

@LonelyMidoriya

@LonelyMidoriya LonelyMidoriya commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved inline image parsing by removing unintended trailing whitespace from image data.
    • Preserved accurate inline image stream length information for downstream processing.
  • Enhancements

    • Added access to inline image length metadata and stream size for improved image data handling.

@LonelyMidoriya LonelyMidoriya self-assigned this Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Inline image parsing now removes one trailing whitespace byte from collected data. PDInlineImage records the stream length and exposes both the dictionary LENGTH value and stored stream length.

Changes

Inline image handling

Layer / File(s) Summary
Stream trimming and length metadata
src/main/java/org/verapdf/parser/PDFStreamParser.java, src/main/java/org/verapdf/pd/images/PDInlineImage.java
Trailing whitespace is removed from inline image data, while PDInlineImage accepts, stores, and exposes stream length metadata and the dictionary LENGTH value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: maximplusov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding getL and getStreamLength to PDInlineImage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch l-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/org/verapdf/parser/PDFStreamParser.java`:
- Around line 284-289: Guard the trailing-whitespace removal in the inline-image
parsing flow with imageEndFound, so the cleanup executes only after a valid EI
terminator is detected. Update the block following the image collection logic in
PDFStreamParser and preserve the full payload when parsing ends at EOF without a
terminator.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1da93283-e781-4766-9116-953f4a33796e

📥 Commits

Reviewing files that changed from the base of the PR and between ab43cc9 and 805578c.

📒 Files selected for processing (2)
  • src/main/java/org/verapdf/parser/PDFStreamParser.java
  • src/main/java/org/verapdf/pd/images/PDInlineImage.java

Comment thread src/main/java/org/verapdf/parser/PDFStreamParser.java
@MaximPlusov
MaximPlusov merged commit 4e26610 into integration Jul 23, 2026
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.

2 participants