Files
lightcraft/docs/lightroom-catalog-import.md
T
Alex ChambersandClaude Opus 5.5 2e817a45f4 LRC-DEV-PROCESS: process versions, so a look change can ship without changing existing edits (#146)
Each photo's develop settings record the rendering process they are
interpreted by (`DevelopSettings::process`). There is one process, V1, the
pipeline as it is; nothing renders differently (180 CPU 8/16-bit and GPU
renders of procedural scenes, and the saved settings JSON and hash64, are
byte-identical to main).

Settings saved without the field load as V1 (a field-level serde default),
new settings get the latest (`Default`), and V1 is left out when saving, so
files and preview-cache keys stay as they were. A damaged value (anything
but a whole number up to 2^32 - 1) reads as V1 too, so it never costs the
rest of the settings (an unparsable `lc:settings` sidecar is ignored). Reset moves a photo to the
latest process, section and slider resets don't; virtual copies inherit
it; copy / paste / sync / Auto Sync / presets don't carry it; a number from
a newer LightCraft is kept and renders with the newest known process. The
process is not an edit (Edited badges, import-look checks). The base tone
map is chosen per process in one place (`finish::base_tone`, shared by CPU
and GPU). Photo > Update to Current Process (`develop.updateProcess`) moves
selected photos on an older process to the latest as one undo step. Its
menu enablement follows the selection; a call that names photos (`ids` /
`id`) is validated on those instead, through a new opt-in
`CommandSpec::explicit_targets` (execute checks enablement before the
handler sees `ids`). `develop.get` reports the process. The rule and how to add V2:
docs/process-versions.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 17:03:45 +02:00

4.3 KiB
Raw Blame History

Lightroom Classic catalog import

File → Import Lightroom Catalog… opens .lrcat directly. Lightroom, Python, DNG conversion and a C SQLite runtime are not required. The source database is read-only, including committed -wal pages; a catalog that changes during the read is rejected. LightCraft owns subsequent edits.

Equivalent commands:

lightcraft-cli run --library "LightCraft Library" library.inspectLightroom path="Lightroom Catalog.lrcat"
lightcraft-cli run --library "LightCraft Library" library.importLightroom path="Lightroom Catalog.lrcat"

Original files are referenced in place. Ratings, picks/rejects, color labels, XMP metadata, hierarchical keywords, regular collections/collection sets, virtual copies and mapped develop settings are imported. Missing originals remain catalogued for relinking. Existing LightCraft edits are preserved by default; updateExisting=true explicitly replaces them. Persistent import identity prevents reimport from duplicating virtual copies and collections. One undo step reverses catalog changes; any saved recovery archives remain available.

Before changing records, the importer attempts to save source image records, decoded XMP, verbatim develop settings, history, snapshots and collection content to compressed Interop/lightroom-import-N.lca recovery archives in the LightCraft library. Archiving is best-effort: a size limit or write failure produces a warning and does not prevent photo import. Unchanged source data reuses its existing archive. Opaque SQL BLOBs are skipped. Each archive is capped at 32 MiB (uncompressed and on disk), with at most eight archives and 128 MiB total retained. Oldest managed archives are retired; legacy .json archives remain untouched. Interop/lightroom-index.json records imported identities. Source catalogs and originals are never overwritten.

Native import is bounded to a 1 GiB database/WAL, 16 MiB XMP packets and one million rows per table. The in-tree, read-only Rust SQLite B-tree reader follows SQLite’s public file-format specification; it introduces no dependency or C runtime. Table payloads are capped at 256 MiB. Optional history, keyword and collection tables that exceed limits are skipped with warnings; required photo tables still report errors. Unrelated unsupported schemas are ignored. A needed WITHOUT ROWID or virtual table produces an explicit error, handled as a warning when optional.

Develop settings reuse the existing XMP/preset mapper. Supported sliders, curves and supported mask structures remain editable, but this is approximate rendering: camera profiles, Adobe AI models, some masking/retouch fields and process-version algorithms are not reproduced. Unmapped fields are reported. Lightroom's ProcessVersion is not mapped: newly imported photos are on LightCraft's latest rendering process, and photos already in the library keep theirs (process-versions.md). When a recovery archive is saved, it retains source settings/history/snapshots and original smart-collection rules. Smart collections become regular albums with current membership. Archived history and snapshots are source data, not native LightCraft history yet. Lightroom's -999999 deferred-adjustment sentinel is omitted from both catalog and XMP mappings; it is reported, included in any saved archive, and never clamped into a real slider value. Deferred Adobe Auto Tone is not evaluated by the importer; LightCraft's Auto control remains available after migration.

Native desktop inspection/import runs on a cancellable background worker with progress. Only prepared catalog operations commit on the owner thread; archive index writing stays on a worker. Late results from a closed or switched library are rejected, including reopening the same path. Ordinary edits during preparation remain intact. CLI commands complete synchronously using the same preparation/commit pipeline; browser builds reject native catalog import.

Archive version 1 begins with the 12 bytes LC-LRARCH\0\x01Z, followed by zlib-compressed JSON. Recovery readers must cap decompression at 32 MiB. JSON retains source identities, photo paths, settings, decoded XMP, keywords, history, snapshots, collection definitions and membership.

The importer uses shared Rust code on macOS, Windows and Linux. If originals move between computers or volumes, use LightCraft's missing-photo relinking tools to update their paths.