applitools / applitools/ImageTester

-nf drops CropBox: normalized render falls back to MediaBox dimensions

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
11
Forks
11
PR merge metrics
No merged PRs in 30d

Description

PdfFontNormalizer.normalize() copies only the MediaBox to the normalized
page. A source page whose CropBox is tighter than its MediaBox renders at
CropBox dimensions normally, but at MediaBox dimensions under -nf - the
checkpoint changes size and every baseline mismatches.

Pinned by @Ignore'd tests in PdfFontNormalizerEdgeCaseTest
(normalized_page_preserves_cropbox_dimensions,
normalized_render_matches_cropped_dimensions).

Found by code reading during the -nf test-corpus work; no CropBox!=MediaBox
page occurred in the 28-file real-PDF sample.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in PdfFontNormalizer.normalize() and inspect the ignored cases in PdfFontNormalizerEdgeCaseTest: normalized_page_preserves_cropbox_dimensions and normalized_render_matches_cropped_dimensions. Run those tests to confirm the current MediaBox-only behavior; done means normalized pages retain the source CropBox dimensions and cropped renders match their non-normalized dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.