Repository navigation
Add check-images script to pdf build - #481
TylerZeroMaster wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The image check incorrectly rejects images intentionally hidden by print CSS, including by ancestors, causing valid PDF builds to fail.
2 open issues
What changed in this PR
This PR adds image validation to the PrinceXML PDF build, aiming to fail builds when images are missing from the rendered layout or have zero width or height.
Changes:
- Add a script that checks image layout boxes after rendering and flags failures.
- Run the script during PDF generation.
- Include the script in the Docker image.
| File | Description |
|---|---|
dockerfiles/steps/step-pdf.bash |
Pass the image-validation script to PrinceXML. |
dockerfiles/check-images.js |
Detect missing or zero-size image boxes and mark rendering as failed. |
Dockerfile |
Copy the validation script into the container. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Both regression tests accept any nonzero exit status without checking the expected diagnostic, so unrelated failures can pass without verifying image-checker behavior.
1 open issue
2 resolved since last review
Review effort: Balanced
| expect_step_pdf_failure() { | ||
| image_case="$1" | ||
| if SKIP_DOCKER_BUILD=1 \ | ||
| ../enki --keep-data --data-dir "$BOOK_DIR" --command step-pdf --repo 'philschatz/tiny-book' --ref long-lived-branch-for-testing-with-#-char; then | ||
| echo "Expected step-pdf to fail for the $image_case image case" | ||
| exit 1 | ||
| fi | ||
| } |
jivey
left a comment
There was a problem hiding this comment.
That copilot comment about the non-print branch seems interesting, though I'm not very familiar with this, so let me know if I should re-review.


https://openstax.atlassian.net/browse/CORE-4493
Add a script that PrinceXML runs. It reports if any images are missing from the box model or if they have dimensions 0x0. The build fails if any are found.