Skip to content

feat: metadata export-naming tokens + single-image file naming - #1309

Open
SandeepSubba wants to merge 1 commit into
CyberTimon:mainfrom
SandeepSubba:export-naming-feature
Open

feat: metadata export-naming tokens + single-image file naming#1309
SandeepSubba wants to merge 1 commit into
CyberTimon:mainfrom
SandeepSubba:export-naming-feature

Conversation

@SandeepSubba

Copy link
Copy Markdown

Description

Adds image-metadata tokens to export filename templates, and shows the File
Naming section for single-image export (previously it only appeared when
multiple images were selected).

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Filename templates now support metadata tokens matching the Metadata panel's
    editable fields: {title} (ImageDescription), {author} (Artist),
    {copyright} (Copyright), {comments} (UserComment). Values are read lazily
    from the image's cached EXIF and sanitized so they're safe in a filename.
  • The File Naming section now appears for single-image export too; {sequence}
    stays hidden for single images. Single-image export resolves the template via a
    new generate_export_filename command, so it supports the same tokens (dates,
    metadata, original filename) as batch export.
  • A saved/imported template that references an unknown token falls back to the
    default {original_filename}_edited instead of leaking the literal token into
    the output filename.

Screenshots/Videos

Testing

  • I have tested these changes locally and confirmed that they work as expected without issues

Built and ran via tauri dev. Verified the File Naming section now shows for a
single image, the metadata/date tokens resolve into the suggested filename, and
an unknown token falls back to the default. cargo check and the Vite build are
clean.

Test Configuration:

  • OS: Windows 11 Home
  • Hardware: Intel Core i5-12400, NVIDIA GeForce GTX 1660 SUPER

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

  • Metadata tokens are read only when used, from the .rrdata sidecar's cached
    EXIF, so unrelated callers pay no extra I/O. Batch export and the rename/import
    tools get the same tokens for free since they share the template function.
  • For RAW files (e.g. Canon CR2) that lack an ImageDescription, {title} may be
    empty; {author}/{copyright} come through.
  • Note: npm run typecheck surfaces pre-existing strict-tsc errors in the repo
    unrelated to this PR; the Vite/esbuild build does not gate on them.

AI Disclaimer:

  • This PR is entirely AI-generated
  • This PR is AI-generated but guided by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

- Export filename templates now support metadata tokens matching the Metadata
  panel's editable fields: {title} (ImageDescription), {author} (Artist),
  {copyright} (Copyright) and {comments} (UserComment). Values are read lazily
  from the image's cached EXIF and sanitized so they are safe in a filename.
- The File Naming section now shows for single-image export too (previously
  multi-select only); {sequence} stays hidden for single images. Single-image
  export resolves the template via a new generate_export_filename command so it
  supports the same tokens (dates, metadata, original filename) as batch.
- Guard against a persisted/imported template referencing an unknown token
  (e.g. a stray {dcp_title} saved into the last-used preset): unknown tokens now
  fall back to the original default {original_filename}_edited.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SandeepSubba
SandeepSubba requested a review from CyberTimon as a code owner June 26, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant