Skip to content

workbench: a scan can be redacted now, and this page said so before it was true - #63

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

tannevaled merged 1 commit into
mainfrom
feat/jpeg-redaction-is-shipped

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

⛔⛔ The page promised the case it could not do. It said a redaction across
a picture is "the difference between a workbench a reader of scanned paper can
use and one they cannot"
, and two paragraphs later that a JPEG is refused.
Every scanner writes DCTDecode. So the page a reader could redact was the
page nobody has, and the two sentences contradicted each other with one
paragraph between them.

ops v0.38.0 closes it.
The callout added here says the gap existed rather than quietly dropping
the sentence: a reader who tried this and was refused deserves to find out that
it was us, not their file.

What replaces the "open as ops#82" paragraph

  • a JPEG is written back as plain samples, not as another JPEG. Re-encoding
    re-quantises block by block, so every block of the photograph would come back
    changed in order to destroy a corner of it. The file grows, which is the
    trade.
  • a CMYK JPEG is refused rather than converted: there is no faithful
    conversion to RGB without the output profile the file does not carry.
  • past 100 megapixels is refused from the header, before anything is
    decoded: a JPEG declares its size in a handful of bytes and a decoder then
    allocates width × height × 3, so thirty-nine bytes can ask for 1.2 GB.

Refs go-pdfkit/ops#82.

🤖 Generated with Claude Code

…t was true

⛔⛔ THE PAGE PROMISED THE CASE IT COULD NOT DO. It said a redaction across a
picture is "the difference between a workbench a reader of scanned paper can use
and one they cannot", and two paragraphs later that a JPEG is refused. Every
scanner writes DCTDecode. So the page a reader could redact was the page nobody
has, and the two sentences contradicted each other with a paragraph between
them.

ops v0.38.0 closes it, and the callout now says the gap existed rather than
quietly dropping the sentence: a reader who tried this and was refused deserves
to find out that it was us.

What replaces the "open as ops#82" paragraph:

  - a JPEG is written back as PLAIN SAMPLES, not as another JPEG. Re-encoding
    re-quantises block by block, so every block of the photograph would come
    back changed in order to destroy a corner of it. The file grows, which is
    the trade.
  - a CMYK JPEG is refused rather than converted: no faithful conversion to RGB
    without the output profile the file does not carry.
  - past 100 megapixels is refused from the HEADER, before anything is decoded:
    a JPEG declares its size in a handful of bytes and a decoder then allocates
    width × height × 3, so thirty-nine bytes can ask for 1.2 GB.

Refs go-pdfkit/ops#82.

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