Skip to main content

Crate falcon_library

Crate falcon_library 

Source
Expand description

Reading and writing Eagle .library folders.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use library::Library;

Modules§

actions
Actions: named, ordered lists of organising steps with an optional shortcut, run on the selected items. AI steps get their results from the app, which asks the model; here they only become tags or notes.
add_to_library
Adding items, a folder, a smart folder or a tag group of the open library to another library (Eagle’s “Add to Other Library”).
alias
Extensions Eagle accepts as another extension’s name for the same bytes (.jfif is a JPEG, .psdt a Photoshop template). macOS knows some of them by no type, so QuickLook refuses the name even though it reads the contents; falcon maps each to the extension that works and hands QuickLook the file under that name.
audio
Audio decoding: the one path playback, seeking, durations, waveforms and the tempo all read audio through.
autotag
Folder auto-tags: the tags stored in a folder’s tags key, which Eagle adds to every item put into the folder.
backup
Snapshots of the library metadata.json in backup/, kept the way Eagle keeps them, and recovery from them when metadata.json is damaged.
binary_preview
The preview picture inside the binary files of EPS, Illustrator (PostScript flavour), InDesign, Blender, SketchUp and AutoCAD. Used at import when QuickLook has no render (no generator for the format is installed).
color
Turns a picture’s pixels from its embedded ICC profile into sRGB for showing. Falcon draws sRGB, so a picture tagged Adobe RGB or Display P3 would otherwise look dull. Colours outside sRGB are clipped.
combine
Combine Images: several pictures laid out on one canvas and saved as a new PNG. In Eagle this is a plugin (combine-images); this is falcon’s own small version, not a copy of it.
disk_name
What an item’s name is called on disk.
duplicates
Finding duplicate items: exact copies by content hash, and near copies by a perceptual hash of their thumbnails. See the Import chapter of the docs; Eagle stores no hash in item JSON, so nothing here writes to items.
edit
Editing items and tag history, with Eagle’s on-disk effects.
error
Error type for library I/O.
exif
Camera metadata stored at import as rawMetas, in the shape Eagle writes for RAW photos (see the Import chapter of the docs).
export
Export to Computer: copying originals out of the library into a folder the user picked.
folder_import
Importing a folder from disk with its structure kept, after Eagle’s uploadFolderToSidebar: the folder becomes an Eagle folder of the same name, each subfolder a child folder, and every file is imported into the folder that mirrors its parent directory.
fontmeta
Font metadata stored at import as fontMetas, in the shape Eagle’s font parser produces (see the Import chapter of the docs).
fontpreview
Font specimens: the 600×600 picture Eagle renders as a font item’s thumbnail (see the Thumbnails chapter of the docs), drawn with resvg using only the font itself.
hdr
High dynamic range images (Radiance HDR and OpenEXR): decoding to linear floating point and tone mapping for display.
ids
Item and folder IDs.
imageio
Pictures macOS decodes through ImageIO: AVIF, HEIC and HEIF, JPEG XL (macOS 14 and later) and their animated forms (AVIF and HEIF sequences). The image crate reads none of them, so on macOS these decode here at full resolution, turned by their orientation, and animated files hand out their frames and delays. Elsewhere every call fails and callers fall back to QuickLook or a placeholder.
import
Importing a local file into a library, following Eagle’s processImage.
import_check
The duplicate check on import, after Eagle’s Duplicate File Alert.
inboard
Reading an Inboard backup folder for import, as Eagle’s File ▸ Import ▸ Inboard does.
item_ops
Item commands that work on an item’s files or on per-item keys Eagle writes for them: Duplicate, Replace with File, changing the extension, Pin to Top inside a folder and marking a palette colour as the item’s primary colour.
keywords
Embedded keywords that can become tags on import: IPTC keywords (IIM record 2, dataset 25) and XMP dc:subject, read from JPEG, PNG and TIFF. See the Import chapter of the docs for how Eagle does it.
library
Loading and saving whole libraries.
library_icon
The library’s own icon, icon.png in the library root. Eagle shows it next to the library name in the library switcher.
library_merge
Merging another Eagle library into the open one (Eagle’s Library ▸ Import Library).
manual
Hand-arranged (“manual”) item order inside a folder.
media
Durations of audio and video files, stored at import as duration (seconds, with a fraction, as a browser’s media element reports it).
merge
Merging duplicate items, as Eagle’s duplicate panel does: one item of each group is kept and takes the name, link, note, folders, tags and rating chosen for the group; the others go to the Trash. Nothing is deleted, and the kept item is saved like any other edit, so an open undo transaction can put everything back.
mhtml
MHTML web archives (.mhtml): reading the MIME parts (RFC 2045, 2046, 2047 and 2557) and unpacking them into a folder a browser engine can load from disk.
model
On-disk types for an Eagle library. Field order mirrors Eagle’s own key order so that compact serialization is byte-identical. Unknown keys are kept in extra and written after the known ones.
model3d
3D models: readers for the formats falcon can show itself (OBJ with MTL colours, STL, PLY, GLB, 3MF, FBX, COLLADA, 3DS and IFC), the triangle model they produce, the measurements Eagle’s model viewer shows, and the geometry the viewer and the thumbnail renderer share (normals, feature edges, shading).
pack
.eaglepack export and import.
palette
Dominant-colour palettes, matching Eagle’s palettes field.
paths
Where the user’s folders are, and paths written the way a reader expects.
psd
The merged (composite) image of Photoshop PSD, PSDT and PSB files, read from the public Adobe file format specification: header, colour mode data, image resources (ICC profile, EXIF orientation, version info, indexed transparency), the layer section (skipped, but for whether the merged image has transparency) and the image data, raw or RLE.
rename
Batch renaming, worked out the way Eagle’s Rename dialog does: either a name template with counters, dates and the original name, or a find and replace (plain text or /regex/flags), then an optional change of case. Only names are computed here; callers save them.
repair
Clear Invalid Content: finding item folders that are empty or broken, after Eagle’s repair tool of that name.
search
Keyword search, filter-panel rules, colour matching and sorting, following Eagle’s behaviour (see the Search and filters chapter of the docs).
smart
Smart folders: saved rule sets in the library metadata.json (see the Smart folders chapter of the docs). Entries stay raw JSON in LibraryMetadata so they round-trip untouched; this module reads, evaluates and edits them.
smart_draft
The smart folder dialog’s editable form of conditions, kept free of any UI so it can be tested on its own.
sync
Picking up changes other apps make to an open library: a sync tool (Dropbox, iCloud, Syncthing), Eagle on another machine, or the falcon CLI.
tagging
Tag edits on selected items and the tag history, as Eagle’s tag picker makes them.
templates
Blank documents falcon writes itself, for File ▸ New….
tempo
Tempo detection for audio items, stored at import as bpm.
text
Saving a text (.txt) item edited in the app’s text viewer.
thumbnail
Thumbnail rules and rendering, following Eagle’s thumbs/ modules.
transform
Rotating, flipping and cropping an item’s original file, following Eagle’s viewer.
undo
Undo transactions and batched writes.
waveform
Audio waveforms: decoding a file to mono peaks and drawing the waveform picture Eagle uses as an audio item’s thumbnail (see the Thumbnails chapter of the docs). Eagle caches no peak data on disk, so neither does falcon.
weblink
Reading the address out of link files: Windows .url shortcuts (an INI file), the link format in Eagle’s list. A macOS .webloc is a plain item, as in Eagle.
webp_convert
Converting WebP items to PNG or JPG (Eagle’s Convert WebP, offered in the item menu when the item is a WebP).
zip_preview
The preview picture inside the zip containers of Sketch, XMind, Keynote and IDML files (and SketchUp files saved as a zip). Used at import when QuickLook has no render (no generator for the app is installed).