Open a picture, and get a page - #16
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 vetand-raceclean, the wasm build, and the browser check.