Hand over every page at once, and hand over the words - #21
Merged
Conversation
A page at a time is no use for a document of two hundred, and a browser handed two hundred downloads at once asks about each of them. Every page now comes out as one zip of PNGs — which is also what a comic reader opens under the name CBZ, the same file with another suffix. And what a page says is handed over as a .txt. The reading beside it has been showing those words on the screen all along with no way to take them away. Both refuse rather than hand over something misleading. A page that will not draw stops the zip, a page whose words cannot be read hands over nothing rather than an empty file that would read as a blank page, and a document still being drawn when its time ran out says how many of its pages were cut short. The zip is built in memory, so the three errors a zip.Writer can report cannot happen here: Create only refuses a name already used or a writer already closed, and a bytes.Buffer never fails to take bytes. They are not handled, and why is written where they would have been. 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.
A page at a time is no use for a document of two hundred, and a browser handed two hundred downloads at once asks about each of them. Every page now comes out as one zip of PNGs — which is also what a comic reader opens under the name CBZ, the same file with another suffix.
And what a page says is handed over as a
.txt. The reading beside it has been showing those words on the screen all along, with no way to take them away.Both refuse rather than hand over something misleading: a page that will not draw stops the zip, a page whose words cannot be read hands over nothing rather than an empty file that would read as a blank page, and a document still being drawn when its time ran out says how many of its pages were cut short.
The zip is built in memory, so the three errors a
zip.Writercan report cannot happen here —Createonly refuses a name already used or a writer already closed, and abytes.Buffernever fails to take bytes. They are not handled, and why is written where they would have been.Parity: BentoPDF's PDF to Image for a whole document, PDF to CBZ, and PDF to Text.
100% statement coverage,
go vetand-raceclean, the wasm build, and the browser check.