Repository navigation
OCR: leave a page's own design alone, and never crash the same PDF twice - #295
Merged
Merged
Conversation
A textbook whose every page is a full-page picture of boxes and borders under real text (De finale 2025, 332 pages) was OCR'd page after page: the picture counted as a figure on a page with text (TEXT_WITH_FIGURES), and its content check took the boxes' edges for content. The iPad drew each page at up to 2200 px to find the page's own text again, and crashed after 17. - classifyPage: a picture that fills the page to within 1 % of every side, under text that runs down at least half the page (textSpread, 12 bands), is the page's design and is not read. Measured with Obsidian's pdf.js over the vault: De finale 332 -> 27 pages read; no page changes in six slide decks and a 1,114-page textbook (their screenshots and plots stop 37 pt and 110 pt short of an edge, and are still read). - OcrService: a crash mark is stored on this device before each page (ReadingGuard, its own key); a mark left at the next start keeps that PDF from being read here again until its bytes or FineNotes' version change, with a notice. Reading starts at every opening, so without it a PDF too heavy for a device took it down each time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 textbook whose every page is a full-page picture of boxes and a border under real text (De finale 2025, 332 pages) was OCR'd page by page on the iPad, which crashed after 17 pages. The picture counted as a figure (
TEXT_WITH_FIGURES), and the content check took the boxes' edges for content. The readings found the page's own text again.classifyPage: a picture that fills the page to within 1 % of every side, under text that runs down at least half the page (textSpread, 12 bands), is the page's design and is not read. Measured with Obsidian's pdf.js over the vault: De finale goes from 332 pages read to 27, and no page changes in six slide decks or a 1,114-page textbook. Their screenshots and plots stop 37 pt and 110 pt short of an edge, so they are still read.OcrService: a crash mark is stored on the device before each page (ReadingGuard, its own key). A mark left at the next start keeps that PDF from being read on the device again until its bytes or FineNotes' version change, and a notice says so.Gates: lint, lint:review, lint:css, typecheck, build and 10,212 tests pass locally. One test failed only in the local worktree, because it reads
node_modulesby a relative path that the worktree lacks. Not yet tested on the iPad.🤖 Generated with Claude Code