Files
pdfcraft/crates
skylar taylor-barrick 7dc94ce431 fix(redact): rotated and edge-clipped marks fail closed, gray JPEGs decode
Review findings, each reproduced before the fix:
- row_hits built each transformed row's bounding box and skipped it on a
  strict two-axis overlap; a 90-degree cm makes every row vertical (zero
  X extent), so every row was skipped and the original JPEG survived
  the mark untouched behind the overlay. A degenerate row now falls
  through to the per-pixel test; regression: a rotated scan is cleared.
- a mark that clips an image's edge without covering a pixel centre
  left the image as-is; both the JPEG and raw paths now remove such an
  image whole instead (the mark touches it, fail closed). Regression:
  an edge-sliver mark removes the image.
- identity_decode was checked against three components unconditionally,
  so a DeviceGray scan with an explicit /Decode [0 1] was removed whole.
  The check now uses the image's own component count. Regressions: gray
  with identity Decode is cleared; inverted Decode still fails closed.
- the JPEG header's dimensions are now read before the sample
  allocation, so a dictionary that lies small cannot decode a huge JPEG
  past MAX_PIXELS; mismatches fail closed as before.

46 redact tests green; clippy/fmt clean; wasm32 check passes.
2026-10-14 16:18:01 -06:00
..