Skip to content

landing: the scan sentence was about a page nobody has, until ops v0.38.0 - #77

Merged
tannevaled merged 1 commit into
mainfrom
feat/jpeg-redaction-ships
Nov 11, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/jpeg-redaction-ships

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

⛔ Two clauses one sentence apart cancelled each other out. The card said a
redaction destroys the samples under a picture, "which is what a reader of
scanned paper needs, a scan being one picture across the whole page"
, and then
that it refuses "a JPEG above all". Every scanner writes DCTDecode. The
scanned page the landing offered was the one page a scanner cannot make.

ops v0.38.0 decodes
the JPEG and writes it back as plain samples rather than re-encoding it:
re-encoding re-quantises the photograph block by block and would degrade every
block in order to destroy a corner of it. What goes back is exactly what a
reader of the original would have seen, with the region gone — the file grows
instead of the picture changing.

The refusals that remain are named instead of being covered by a sweeping
one: a picture drawn turned or twice, one carrying a mask, a CMYK JPEG (no
faithful way back to RGB without the profile the file does not carry), and
anything past a hundred megapixels — read from the header, because a JPEG
declares its size in a handful of bytes and a decoder then asks for
width × height × 3.

landingmigrate repeats layouts/index.html after the edit: 0 hideable, the
four fragments it lists all KEPT, says more as before.

Refs go-pdfkit/ops#82.

🤖 Generated with Claude Code

…38.0

The card said a redaction destroys the samples under it, "which is what a
reader of scanned paper needs, a scan being one picture across the whole page",
and then that it refuses "a JPEG above all". Every scanner writes DCTDecode, so
those two clauses cancelled each other out one sentence apart: the scanned page
the landing offered was the one page a scanner cannot make.

ops v0.38.0 decodes the JPEG and writes it back as PLAIN SAMPLES rather than
re-encoding it — re-encoding re-quantises the photograph block by block and
would degrade every block in order to destroy a corner — so what goes back is
exactly what a reader of the original would have seen with the region gone, and
the file grows instead of the picture changing.

The refusals that remain are named instead: a picture drawn turned or twice,
one carrying a mask, a CMYK JPEG (no faithful way back to RGB without the
profile the file does not carry) and anything past a hundred megapixels, read
from the HEADER because a JPEG declares its size in a handful of bytes and a
decoder then asks for width × height × 3.

`landingmigrate repeats layouts/index.html` after the edit: 0 hideable, the
four fragments it lists all KEPT/says-more as before.

Refs go-pdfkit/ops#82.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 207c46a into main Nov 11, 2026
3 checks passed
@tannevaled
tannevaled deleted the feat/jpeg-redaction-ships branch November 11, 2026 09:15
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.

1 participant