#1737·OCRmyPDF

Feature request: emit deskew transform parameters as a JSON sidecar (--deskew-transform)

Author: WSHAPERCreated Aug 27, 2026Updated Aug 27, 2026

Description

When --deskew runs, the rotation angle is applied and then discarded, so downstream tools that consume OCR coordinates (hOCR word boxes, text-layer geometry) cannot map OCR pixel positions back to the original scan. Coordinate-opacity reports like #1630 are this class of problem.

Proposal: add --deskew-transform [FILE] (default {output}.deskew.json) that records, per page, the parameters preprocess_deskew already uses: angle in degrees, image size, DPI, and the rotation semantics (center, expand=False, bicubic, white fill), enough to invert the transform deterministically. Mechanically it would mirror the existing --sidecar text path: per-page JSON fragment in the work folder, merged into one document-level file at the end. No new dependencies.

Schema sketch:

json
{"version": 1, "pages": [{"page": 1, "angle_deg": 1.4, "image_size": [2550, 3300], "dpi": [300, 300], "center": [1275.0, 1650.0], "expand": false, "resample": "bicubic", "fill": "white"}]}

Happy to implement if the format sounds useful.