Skip to content

Open a picture, and get a page - #16

Merged
tannevaled merged 1 commit into
mainfrom
open-a-picture
Aug 29, 2026
Merged

Open a picture, and get a page#16
tannevaled merged 1 commit into
mainfrom
open-a-picture

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Handing a PDF workbench a photograph got "cannot open receipt.png: not a PDF". True, and useless: they knew it was a picture. What somebody hands a picture to a PDF tool for is a PDF of it.

So a file that is not a document is tried as a picture, through ops v0.8.0, which takes every format the fleet reads. What comes back is a one-page document the size of the picture, and every other verb works on it: it can be stamped, cropped, numbered, protected and saved like anything else.

At 72 pixels to the inch — the only guess available, since nothing in a PNG says how large it is meant to be on paper, and the size somebody scanning a receipt or photographing a page expects back.

The document is written once as it opens, because the rest of the workbench reads the file back rather than the document in hand, and a document begun from a picture has no file behind it yet. When that cannot be done there is no document: saying so beats holding one nothing else can use.

100% statement coverage, go vet and -race clean, the wasm build, and the browser check.

Handing a PDF workbench a photograph got "cannot open receipt.png: not a PDF".
True, and useless: they knew it was a picture. What somebody hands a picture to
a PDF tool for is a PDF of it.

So a file that is not a document is tried as a picture, through ops v0.8.0,
which takes every format the fleet reads. What comes back is a one-page
document the size of the picture, and every other verb works on it: it can be
stamped, cropped, numbered, protected and saved like anything else.

At 72 pixels to the inch, which is the only guess available — nothing in a PNG
says how large it is meant to be on paper — and the size somebody scanning a
receipt or photographing a page expects back.

The document is written once as it opens, because the rest of the workbench
reads the file back rather than the document in hand, and a document begun from
a picture has no file behind it yet. When that cannot be done there is no
document: saying so beats holding one nothing else can use.

100% statement coverage, go vet and -race clean, the wasm build, and the
browser check.
@tannevaled
tannevaled merged commit d3c03e0 into main Aug 29, 2026
2 checks passed
@tannevaled
tannevaled deleted the open-a-picture branch August 29, 2026 19:20
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