Repository navigation
Conversation
A cache entry or failure marker was trusted on its modified time alone, so one made for another file with the same time was shown as this file's. It now has to carry this file's Thumb::URI as well, as the thumbnail spec asks a reader to check.
Failure markers went to fail/folio, so a file Folio could not thumbnail stayed blank after it learned to, as it does for camera RAW here. They now go to the spec's fail/<program>-<version>, as fail/folio-2: the number is raised whenever Folio learns to draw more.
A thumbnailer that names a type only by an alias never matched the canonical name Folio asks with, so glycin's image/x-dds left a DDS file blank. The declared types are resolved to canonical names once, when the thumbnailers are read.
A CR2, NEF, NRW, ARW, SR2, DNG or PEF showed a blank tile unless a RAW thumbnailer was installed. The camera stores a finished JPEG in each, and a bounded reader of the TIFF directories now finds the largest one. An installed thumbnailer still answers first.
A type with no installed thumbnailer showed a blank tile and nothing else. The details pane now says which optional package draws it, from the types ffmpegthumbnailer, papers, glycin and libgsf declare.
A file nothing installed could draw kept its failure marker, so a thumbnailer installed afterwards never ran for it. The marker now records the thumbnailer the type had, none included, and holds the file back only while that is unchanged.
One orientation was kept for the whole file, so a preview whose directory names a turn of its own was turned by IFD0's instead. Each embedded JPEG now carries its directory's orientation, and takes the file's only when its directory names none.
With Poppler installed and no PDF thumbnailer, a PDF that failed to draw (damaged, or locked with a password) had the details pane name papers as missing. A PDF's package is now named only when pdftoppm is not there either.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A JPEG may put 0xFF fill bytes ahead of a marker, and the Exif segment of one that did was missed, so an upright preview got the RAW's turn. And the walk followed IFD0's next pointer into IFD1, the Exif thumbnail's directory, whose orientation then passed for the picture's. Only IFD0's own Orientation is read now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Markers moved from fail/folio to fail/folio-2, and nothing reads the old folder again. It is removed on a worker thread at start, as is any fail/folio-<n> a later bump leaves behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The start-up sweep listed fail/folio and fail/folio-* with QDir::Dirs, which includes symlinks to folders, and removeRecursively() deletes through a link: a fail/folio that pointed elsewhere had everything it pointed at deleted. Symlinks are now skipped. It also removed every fail/folio-<n> but the current one, so an installed Folio and a newer build run side by side cleared each other's markers on every start. Only plain fail/folio and lower numbers are removed now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A preview is no longer ranked when its frame header claims more than 250 million pixels, more than any camera's; a few KiB claiming 57000 by 56000 otherwise ranked first and cost a 270 MB decode that failed, up to sixteen times per file. The header budget now caps the number of reads as well as their bytes: each read is its own system call, a round trip on a network mount, and crafted directories reached some 60,000 tiny reads within the byte budget. The embedded JPEG is read into a buffer with room for the Exif segment, so putting the segment in front no longer copies up to 64 MiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Elsewhere in this file "the spec" is the freedesktop thumbnail spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
[Medium impact] The PR appears safe to merge; the latest change fixes the previously reported cleanup problem. SummaryAdds embedded RAW previews, checks cached thumbnails against their file URI, improves retries, and names optional thumbnail packages.
Reviews (2) · Last reviewed commit: "Never clear failure markers through a fa..." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
Contributor
Author
|
Thank you @thisisgm! This branch had grown past what's easy to review at once, so its parts have been taken into focused pull requests off today's main, each crediting you:
What isn't carried on, and why:
Closing this in favor of those PRs. |
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.
By GM (@thisisgm), from #17: the work and the description below are theirs, with their commits kept as they made them. This pull request carries it on from our own branch, with the fixes from review added as commits on top, so it can land without waiting on a push to their fork.
Six changes to thumbnails, one commit each with its own tests: camera RAW files show their picture without a RAW thumbnailer, a cached thumbnail has to belong to its file, a failure is tried again once Folio can draw more, a thumbnailer is found through a type's aliases, a type nothing installed can draw says which package would, and a thumbnailer installed later draws what failed before. Two smaller commits on top answer review: a RAW preview is turned by its own directory's orientation, and no package is named for a PDF that
pdftoppmdraws. No library is linked in and nothing new is needed to run.What you'd notice
Thumb::URI, as the thumbnail spec asks a reader to check; otherwise the thumbnail is made again.fail/folio, so a file one release could not thumbnail stayed blank under every later one, as camera RAW would here. They now go to the spec'sfail/<program>-<version>, asfail/folio-2: the number is raised whenever Folio learns to draw more.image/x-ddsand the file isimage/vnd.ms-dds. Declared types are resolved to canonical names once, when the thumbnailers are read. On a stock Omarchy install 23 of the 196 declared names are aliases, and DDS pictures and WAV audio gain the thumbnailer they already had.pdftoppmis there to draw it.Numbers
Measured on a mini PC with no RAW thumbnailer installed, cold start, main against this branch. Both tables are from the branch as it stands on the CMake build.
A folder of 100 RAW files in twelve formats, three runs each:
The rest of Folio pays nothing for it. Time until the window is up and the process has gone quiet, six runs a view:
The ranges overlap in every view, and the media folder draws the same 105 thumbnails on both.
Screenshots
One RAW file from each of twelve cameras, main above and this branch below: Nikon, Pentax and Sony gain their picture.
A cache entry written for another file (the first tile, which should be red) and one that names no file (the third, flipped so it shows), each with a matching modified time, main on the left and this branch on the right:
The details pane for a video with ffmpegthumbnailer not installed, before and after:
Changed in review
fail/folioand olderfail/folio-<n>folders now leaves links alone; following one would have emptied the folder it pointed to, outside the cache. A newer Folio's markers are left too.Reviewed with Codex.
🤖 Generated with Claude Code