Expand description
Thumbnail rules and rendering, following Eagle’s thumbs/ modules.
Eagle stores thumbnails as lossy WebP (quality 75) under the name
<name>_thumbnail.png; sides above 16383 px fall back to JPEG at 0.7.
See the thumbnails chapter of the docs for what is observed and inferred.
Structs§
- Page
Thumbnail - A page screenshot made ready to save: encoded and its palette taken. Slow, and needs no library.
- Plan
- What to do about an item’s thumbnail.
- Spotlight
- What Spotlight knows about a file’s pixel size and duration.
- Thumb
Error - Failure while decoding, rendering or encoding an image.
Enums§
- Quick
Look Stop - Why
quicklook_untilgave no picture.
Constants§
- CUSTOM_
THUMBNAIL_ KEY - Item key Eagle sets when the thumbnail was chosen by the user.
- CUSTOM_
THUMBNAIL_ MAX_ BYTES - Largest file Eagle accepts as a custom thumbnail, in bytes.
- DEFAULT_
MAX_ SIDE - Short-side limit for ordinary images.
- FRAME_
THUMBNAIL_ SIDE - Short side a frame chosen in the GIF player is brought down to.
- JPEG_
QUALITY - JPEG quality (0.7) used past
MAX_WEBP_SIDE. - MAX_
WEBP_ SIDE - Largest side WebP can hold; beyond it Eagle writes JPEG.
- NO_
THUMBNAIL_ FILE_ SIZE - … as long as its file is no larger than this many bytes.
- NO_
THUMBNAIL_ SIZE - An image up to this many pixels per side may be shown without a thumbnail.
- PNG_
FORCE_ THUMBNAIL_ SIZE - A PNG this large always gets a thumbnail, whatever its dimensions.
- QUICKLOOK_
SIZE - Long side of QuickLook renders, matching the size Eagle reports for documents such as PDFs.
- QUICKLOOK_
TIMEOUT - How long a QuickLook render may take.
- SVG_
INLINE_ LIMIT - SVGs smaller than this (bytes) are displayed directly.
- THUMBNAIL_
AT_ KEY - Item key Eagle sets to the second a video’s thumbnail was taken at.
- VIDEO_
THUMBNAIL_ WIDTH - Width Eagle draws a video’s thumbnail at, whatever the video’s size.
- WEBP_
QUALITY - WebP quality used by Eagle.
Functions§
- custom_
thumbnail_ allowed - Whether an item of this extension may get a custom thumbnail. Eagle hides the command for the image formats it shows as themselves (tif, jpg, png, bmp, webp); jpeg and tiff are falcon’s addition, as the same formats.
- custom_
thumbnailed - The file work of
crate::Library::set_custom_thumbnail, without the library: checksimage, copies it over the thumbnail ofitem(in the library atroot) and returns the item as it should be saved. Lets a caller that shares the library read and write files without holding its lock. - decode
- Decodes a raster image, applying its EXIF orientation. Sniffs the format
from content, so it also reads Eagle’s WebP-in-
.pngthumbnails. - decode_
for_ display decodefor showing: the pixels are turned into sRGB through the file’s colour profile (seecrate::color). Whatever rewrites the file usesdecodeinstead.- encode
- Encodes
imgas Eagle does: lossy WebP at quality 75, or JPEG at 0.7 when a side exceeds 16383 px. - frame_
thumbnail_ size - The size Eagle draws a GIF frame thumbnail at: the short side brought
down to
FRAME_THUMBNAIL_SIDE, never enlarged. - has_
custom_ thumbnail - Whether the item’s thumbnail was set by hand (
customThumbnail: true). - is_
supported - Whether falcon can decode and thumbnail this extension (lowercase, no dot).
- jpeg
imgas a JPEG atquality(1..=100), alpha dropped.- max_
side - The short-side limit for
ext: 320 for ordinary images, 512 for icon formats, 480 for documents, design files and other large-canvas formats. 3D models are not scaled down: Eagle keeps its 1080 render (plus the padding) as is. - plan_
raster - Plan for a raster image of
wxhpixels andfile_sizebytes. - plan_
svg - Plan for an SVG of
file_sizebytes whose render succeeded. A thumbnail is always rendered (it feeds the palette); small SVGs delete it afterwards. - plan_
svg_ failed - Plan for an SVG that failed to render: no thumbnail,
noThumbnailonly. - quicklook
- Renders a preview of any file macOS QuickLook understands, with its long
side at most
size. - quicklook_
until quicklook, giving up aftertimeoutor oncecancelis set, either of which killsqlmanage.- raw_
preview - The largest JPEG preview embedded in a RAW photo, turned by the file’s
EXIF orientation when it has one (from its TIFF IFDs, RAF’s preview
EXIF, CR3’s
CMT1, MRW’s TTW block, X3F’s preview or CRW’s rotation record; seecrate::exif::orientation). Eagle’s RAW viewer shows the preview dcraw extracts; falcon finds the same kind of picture by scanning for baseline or progressive 8-bit JPEG streams and keeping the one with the most pixels (the camera’s full-size preview rather than its thumbnail), in sRGB when the preview has a colour profile. - redrawn
- The file work of Refresh Thumbnail, without the library: re-reads the original’s file times, redraws thumbnail and palette, and returns the item as it should be saved.
- render_
svg - Renders an SVG. With
max, it is drawn straight attarget_size; without, at its natural size. - render_
svg_ region - Renders part of an SVG at
sizepixels:regionis the part to draw, as fractions of the drawing ([x0, y0, x1, y1], 0..1). The viewer uses it to stay sharp when zoomed in, drawing only what is on screen. - resize
- Scales
imgpertarget_size; returns it unchanged when it fits. - resize_
with resizewith an explicit filter.- spotlight
- Reads pixel size and duration from Spotlight (
mdls). Files Spotlight hasn’t indexed, such as ones in temporary folders, give nothing. - svg_
size - Natural pixel size of an SVG file’s contents.
- target_
size - Target size for a
wxhimage with short-side limitmax. - video_
thumbnail_ jpeg - Encodes a video frame the way Eagle’s thumbnailer does: drawn at
video_thumbnail_sizeand saved as a JPEG at full quality. Eagle writes those JPEG bytes under the usual_thumbnail.pngname. - video_
thumbnail_ size - The size of Eagle’s video thumbnail for a
w×hframe: 480 wide, the height scaled to match and cut to whole pixels (a canvas size). - write_
encoded - Encodes
imgas is and writes it todest. - write_
thumbnail - Resizes
imgto the limitmaxand writes the encoded thumbnail todest.