Repository navigation
Lightroom preset import: "Ask what to do" is reported, and the numbering tokens Lightroom never writes are no longer read - #1849
Merged
emmertex merged 5 commits intoDec 2, 2026
Conversation
…s reported Problem: a Lightroom Classic export preset with `collisionHandling = "ask"` imported without a word, although "Ask what to do" has no counterpart here (an export never stops to ask); the preset then numbers a name that exists. Change: the import report names it and says what the preset does instead; "rename" (our Add number) stays silent, overwrite and skip are unchanged. Tests: lightroom_existing_files_setting_ask_is_reported_and_the_others_are_not (all four values under Lightroom's unprefixed key, plus the import result and the stored preset); fails without the change (0 report rows instead of 1). Manual: output/export-presets.mdx Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d as the sequence number
Problem: the importer read `naming_imageNumber*` and `naming_totalNumber*`
as `{seq:N}`. Lightroom writes neither (Image # is `naming_operationSequence_*`,
Total # is `naming_sequenceTotal_*`, and it renders `naming_totalNumber_*` as
nothing), so a total came out as the sequence number again.
Change: the two guessed spellings are removed from the mapping and fall into
the existing "unknown file name token" report; `naming_sequenceNumber_*` still
maps to `{seq:N}`, and the real Image # and Total # tokens are still reported
as unknown. The code comment that cited `naming_imageNumber_5Digits` is fixed.
No existing test pinned the guessed spellings (none changed).
Tests: lightroom_numbering_tokens_map_only_the_sequence_number; fails without
the change (the guessed spellings came out as `{seq:4}|{seq:2}|{seq:1}`).
Manual: none, no user-visible change beyond the import report (covered by the
Ask-what-to-do sentence's report line)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…quality and run-parameter behaviour pinned Housekeeping from a code review. - `Found.unmapped` and `preset.unmapped` held the same list through a clone; only `preset.unmapped` is kept (no behaviour change: the report row and the stored preset still carry it). - In a native `.lcexport` file the parameters that name one export run (`id`, `ids`, `path`, `preset`, `background`, `pluginDestination`) are dropped without a report line. Decision: they are not preset settings (our exporter never writes them into a preset), so listing them would be noise next to the settings that were really not carried over; a comment says so and a test pins it, with an unknown key still reported and `dir` kept. - Pinned, no change in behaviour: a Lightroom preset with no `size_doConstrain` imports at full size and, like one with the key false, ignores the other size keys without reporting them; `jpeg_quality` 1 imports as 100 and 0.01 as 1. Tests: a_presets_unmapped_list_is_the_same_in_the_report_and_the_stored_preset, export_run_parameters_in_an_own_preset_file_are_dropped_without_a_report_line, a_lightroom_preset_without_constrain_imports_at_full_size, a_lightroom_jpeg_quality_is_a_fraction_of_one. They pin current behaviour, so they pass before and after; each was checked against a temporary mutation of the code (quality `<=` to `<`, full size only when `format` is set removed, `background` no longer dropped) and failed under it. Manual: none, no user-visible change Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rt-ask-and-numbering-tokens
…rt-ask-and-numbering-tokens
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.
In short: two fixes to importing Lightroom Classic export presets (
.lrtemplate), found by checking the importer against presets and filename templates that Lightroom Classic wrote itself. If file exists: Ask what to do was imported silently, and the importer read two numbering-token spellings that Lightroom never writes as the sequence number.How these were found
On my own Lightroom Classic install (read-only: nothing was written into its folders by the tooling, and no Adobe file is in this PR) I read the presets it had saved, then built variants of one of them (one setting changed each), imported them through its Export dialog, had Lightroom re-save them, and ran this importer on the result. I also built a filename template in Lightroom's own template editor and read its token names. Only key names and values are used; the tests build their own bytes.
Change
collisionHandlingwith"ask","rename","overwrite"or"skip"."overwrite"and"skip"were already read, and"rename"is our Add number."ask"has no counterpart here (Lightroom prompts), and it was dropped without a word; the import report now says so, and that the preset numbers a name that exists.naming_sequenceNumber_NDigit(s)for Sequence # (it uses the Start Number),naming_operationSequence_NDigit(s)for Image # andnaming_sequenceTotal_NDigit(s)for Total #. It does not writenaming_imageNumber…ornaming_totalNumber…(it renders the latter as nothing). The importer mapped those two guessed spellings to{seq:N}, so a total number became the sequence number again. They are removed from the mapping, so they and the real Image # and Total # tokens land in the report as file name tokens without a counterpart (our rename tokens have no total).unmappedlist per preset (it was stored twice).size_doConstrain, orsize_doConstrain = false(Lightroom then writes no other size key), imports at full size;jpeg_quality1 imports as quality 100 and 0.01 as 1; the native-file run parameters (id,ids,path,preset,background,pluginDestination) are not reported as preset settings.output/export-presets(the sentence listing what the import report says). What's new and changelog entries.How it was checked
an_ask_existing_files_setting_is_reported_and_rename_is_not, the real Image # and Total # spellings are reported as unknown tokens whilenaming_sequenceNumber_3Digitsstill maps to{seq:3}, and a test that the report row equals the stored list; the first two fail with the old code put back. The size, quality and run-parameter pins were each checked against a temporary mutation. Before and after on the M1:cargo xtask ci --quick(fmt, brand, quarantine, docs, notes, i18n, windows, clippy, stamp, parity, layers, assets, wasm, deny pass; lcc-engine tests pass exceptdevice_sync::tests::a_shared_collection_brings_photos_files_and_edits_both_ways, environmental on that machine, andrun_presets::tests::a_run_makes_previous_export_and_runs_the_plugin_hooks_and_destination, a "plug-in busy" flake that also fails on plainstagingafter a fresh build). After merging the lateststaging: fmt, brand, notes and docs checks, clippy-D warningson lcc-engine, and the preset importer tests (26, 156 and 68) pass; the full gate was not re-run.🤖 Generated with Claude Code