Commit Graph
13 Commits
Author SHA1 Message Date
FredApps 08c9d59ae6 LR-EDIT-OPTICS-PROFILE: the no-lenses warning gives the counts; an unfinished download is logged at info (#2511) 2026-11-04 15:30:32 +01:00
FredApps 18b914b9ff LR-EDIT-OPTICS-PROFILE: the log says where the lens database was read from and what it holds, and warns when it has no lenses (#2511) 2026-11-04 14:44:54 +01:00
FredApps 86092b330e LR-EDIT-OPTICS-PROFILE: merge main (#2676: unknown crop factors stay unknown; its lookup test expects the database source) 2026-11-04 14:00:53 +01:00
r3d42-gitandCodex d72f3840bc LR-EDIT-OPTICS-PROFILE: prefer known crop in fixed-lens score ties
Use the same exact-score known-crop preference as best_lens in the built-in fixed-lens fallback. Preserve higher-score priority and cover both profile orders through the public lookup API.

Validated with 33 lensdb and 5 engine lens-profile tests, plus full cargo xtask ci (8/8, Rust 1.95.0, Apple M5 Max Metal and WASM). The new tie regression fails against the previously published selector. No workflows or lockfile changes.

Co-authored-by: Codex <noreply@openai.com>
2026-11-02 10:21:22 +01:00
OneSlipsandClaude Opus 5.5 2cd071c722 LR-EDIT-OPTICS-PROFILE: the lens database is offered on first launch and downloads on request (#3073)
Nothing is fetched without the user's click. The first desktop start without a
database (and without LIGHTCRAFT_LENSFUN_DIR) asks once, "Download lens profiles?",
with the size added up from the pinned files, and Download / Not Now. Download
starts the existing pinned download (activity row, cancel); Not Now (or Esc)
fetches nothing and the app doesn't ask again. Settings > General > Lens profiles
has a Download Lens Database button and a switch that turns the offer back on.
The answer is kept in ui.json (lensDatabase: ask / accepted / declined; an
unreadable value asks again), and lensfun_download::fetch_on_start is the one
place that decides. The CLI and headless MCP never ask and never fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 08:29:30 +10:00
OneSlipsandClaude Opus 5.5 b7da696411 LR-EDIT-OPTICS-PROFILE: review fixes (CodeRabbit, #3073)
A discarded stale lookup asks for a frame so the current one runs in an idle
window; Enable Lens Corrections' look-up list dedups with a set; the lens
profile doc says the CLI and headless MCP never start the first-run download
(lens.downloadDatabase still fetches on request) and that
LIGHTCRAFT_LENSFUN_DIR only stops the first-run download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 03:57:32 +10:00
OneSlipsandClaude Opus 5.5 f267ddb504 LR-EDIT-OPTICS-PROFILE: pinned profiles, whole-folder install, shared hosts (review, #3073)
Render caches: a database lens profile is pinned to the photo. A decode never
overrides the catalog's database profile (media::source::pinned_lens), and
the profile is part of the render, thumbnail and variant cache keys
(media::quick::lens_key; only database profiles with the correction on, so
existing thumbnails keep their keys). When a download replaces the
database's files (lens_profiles::replaced), the refresh also re-reads raws
whose profile came from the database and raws that named no lens; an
ordinary start does not. library.refreshLensProfiles takes {all: true}.

Installation: files are staged beside the database folder, SOURCE.txt is
written there last, and the staged folder replaces the old one as a whole;
a failed swap puts the previous database back (and recover() does at the
next start). The app's own folder is read only with its marker, and
installed() checks every pinned file at its pinned size.

Shared hosts: with_default_lens_database() only selects the existing folder;
the permission to fetch is with_lens_auto_download() (desktop only), and the
first-start decision is one function, lensfun_download::fetch_on_start.
CLI render / merge and the headless MCP server select the folder;
lens.downloadDatabase selects the folder it downloads into.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 03:20:10 +10:00
OneSlipsandClaude Opus 5.5 b3b792f74d LR-EDIT-OPTICS-PROFILE: merge main (file split)
Main split the app's main.rs, the engine and ui-egui tests and the
frame loop into modules; the lens-database hunks now live in
apps/lightcraft/src/session.rs, crates/ui-egui/src/app/frame.rs and
crates/engine/src/tests/lens_refresh.rs. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:09:15 +10:00
OneSlips 2ec4add0d6 LR-EDIT-OPTICS-PROFILE: lensfun database downloaded on first run, library looked up, Optics names the profile
- lensfun's data/db (CC BY-SA 3.0) is fetched by the desktop app on first
  run into <config dir>/lensfun, pinned to commit 43f9e001 by name, size and
  SHA-256, staged until every file is verified, with an activity row (never
  bundled). LIGHTCRAFT_LENSFUN_URL lists other mirrors; LIGHTCRAFT_LENSFUN_DIR
  still wins. lens.downloadDatabase / lens.databaseStatus for agents.
- The database is read per folder and again after a download; when it
  changes, library raws without a profile whose lens it knows are probed in
  the background and get it (untouched photos switch the correction on as
  import would); ticking Enable Lens Corrections looks those photos up again
  (library.refreshLensProfiles).
- EmbeddedLens records its source (file / lens database); the Optics panel
  says "Profile: <lens> (lens database)", "Profile: from the file" or
  "No lens profile found for <lens>." (13 locales).
- Tests: pinned download and refusal of a wrong file, the lookup and its
  edited / untouched rules, and presets / Copy-Paste / Sync carrying only the
  switch and amounts, each photo keeping its own lens's profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 773740fbb22eb66e7f62bada9cb32b594b6ff4d7)
2026-10-27 01:14:00 +10:00
r3d42-git 2e46e9df52 LR-EDIT-OPTICS-PROFILE: preserve unknown crop factors
Keep missing and invalid camera/calibration crops optional. Only absent calibration overrides inherit the parent scale; decline corrections with unknown calibration scale and preserve EXIF fallback for unknown camera crops.

Add synthetic parser, conversion and engine regressions and document the contract. The crop-only patch is unchanged from a4064b33. Full cargo xtask ci passes all eight gates on current upstream main plus the separate #2544 prerequisite.
2026-10-23 11:07:41 +02:00
nerdislbandClaude Opus 5.5 067f4fdf1e LR-EDIT-OPTICS-PROFILE: look up Nikon DSLR lenses by their lens specification
Nikon DSLRs write no Exif LensModel, only the lens specification (maker note
0x0084, read into Metadata::lens_spec), so the lensfun-format lens database never
corrected their raws. A raw without a lens model is now looked up by a name built
from its specification ("24-70mm f/2.8", lightcraft_lensdb::spec_name), and a
profile is used only when one of its names is exactly that
(Profile::names_exactly): the specification fits every maker's lens with that
range, so a partial match or a maker-named entry is never taken. lensfun's own
database has no such names; a user aliases the one lens they own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 18:42:50 +02:00
Michael Anderson 853a92e2de LR-EDIT-OPTICS-PROFILE: Apply Nikon's in-file distortion correction for the Z 6II and Z f
Read the polynomial, zoom and optical center offset from NikonNEFInfo.
2026-10-13 10:47:57 -05:00
Andrew FrahnandClaude Opus 5.5 80e58ed55b engine: lens profile corrections from a lensfun-format database
Raws without an embedded lens correction look their EXIF lens up in the
user-supplied database; the profile goes through the existing Enable Profile
Corrections path (amount sliders, CPU/GPU geometry stage, DNG export).
Synthetic-grid test renders a distorted chart through the pipeline.

Sources: own design (see lightcraft-lensdb for the model sources).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 19:30:18 +11:00