Repository navigation
README: the thumbnail path, and what it costs - #128
Merged
Merged
Conversation
Asked for through the go-slides session on 2026-10-22, relayed by agentsync and unactioned since: go-widgets/toolkit has PageStrip, a virtualised strip of page thumbnails, and wants a pure-Go page-to-RGBA rasteriser cheap enough for ~100 thumbnails and safe on untrusted files. The message said: if render already does this, DOCUMENT the thumbnail path; if not, that is the gap. ⛔ It already does, which is why this is a README commit and not a feature. Scale is the thumbnail control, MaxPixels caps what comes out, MaxDuration caps the work of making it, and a timeout returns the page AS FAR AS IT GOT with ErrTimedOut rather than a blank. raster.Image.ToNRGBA hands a toolkit what it wants. Nothing was missing; nothing said so either. MEASURED on a 68-page scanned book, at load average 25 so the figures are pessimistic: 21.9 ms per thumbnail at scale 0.15, 21.7 at 0.25, 20.3 at 0.50. ⛔ THE SCALE BARELY MOVES IT, and that is the part worth knowing. Ten times the pixels cost the same, because on a scanned page the time goes into DECODING THE EMBEDDED IMAGE, not into rasterising it. So for scans a larger thumbnail is nearly free and a smaller one saves nothing -- the opposite of what a caller sizing thumbnails down to save time would assume. Co-Authored-By: Claude Opus 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.
Asked for through the go-slides session on 2026-10-22, relayed by agentsync and unactioned since: go-widgets/toolkit has
PageStrip, a virtualised strip of page thumbnails, and wants a pure-Go page-to-RGBA rasteriser cheap enough for ~100 thumbnails and safe on untrusted files. The message said: if render already does this, document the thumbnail path; if not, that is the gap.⛔ It already does, which is why this is a README commit and not a feature.
Scaleis the thumbnail control,MaxPixelscaps what comes out,MaxDurationcaps the work of making it, and a timeout returns the page as far as it got withErrTimedOutrather than a blank.raster.Image.ToNRGBAhands a toolkit what it wants. Nothing was missing — and nothing said so either, which is the gap this closes.Measured on a 68-page scanned book, at load average 25 so the figures are pessimistic:
⛔ The scale barely moves it, and that is the part worth knowing. Ten times the pixels cost the same, because on a scanned page the time goes into decoding the embedded image, not into rasterising it. For scans a larger thumbnail is nearly free and a smaller one saves nothing — the opposite of what a caller sizing thumbnails down to save time would assume.
🤖 Generated with Claude Code