Skip to content

ahonc/custom-metadata-plugin.lrplugin

Repository files navigation

Custom Metadata Plugin v2.0 — Adobe Lightroom Classic

Plugin that defines custom metadata fields in the Lightroom catalog and allows exporting/importing them as XMP.

  • JPG / TIFF → XMP embedded inside the file
  • RAW (NEF, CR2, ARW, …) → sidecar .xmp file next to the original

Requirements

Component Version
Adobe Lightroom Classic 13+
ExifTool (Phil Harvey) 12.0+

ExifTool: https://exiftool.org — must be available in PATH.


Installation

  1. Copy the CustomMetadataPlugin.lrplugin folder to any location.
  2. In Lightroom: File → Plug-in Manager → Add → point to the folder.
  3. Click Done.

File Structure

CustomMetadataPlugin.lrplugin/
│
│  ┌──────────────────────── EDIT THESE FILES ─────────────────────────┐
│  │                                                                    │
├── FieldDefinitions.lua     ← Field definitions (add/remove fields here)
├── PluginConfig.lua         ← Settings (logging, namespace, RAW ext.)
│  │                                                                    │
│  └────────────────────────────────────────────────────────────────────┘
│
├── Info.lua                    Plugin descriptor
├── PluginLogger.lua            Logging module
├── SharedConfig.lua            ExifTool config generator + utilities
├── CustomMetadataDefinition.lua  Auto-generated metadata provider
├── CustomMetadataTagset.lua      Auto-generated tagset
├── CustomExportFilter.lua        Export filter
├── WriteMetadataToXMP.lua        Menu: write to XMP
├── ReadMetadataFromXMP.lua       Menu: read from XMP
└── README.md

How to Add a New Metadata Field

Edit only FieldDefinitions.lua:

{
    id         = "myNewField",       -- unique ID (a-zA-Z)
    xmpTag     = "MyNewField",       -- XMP tag name (PascalCase)
    title      = "My New Field",     -- display name
    dataType   = "string",           -- "string" or "enum"
    searchable = true,               -- filtering in Smart Collections
    browsable  = true,               -- filtering in Library
    section    = "My Section",       -- group in the Metadata panel
},

For an enum field, add values:

{
    id       = "priority",
    xmpTag   = "Priority",
    title    = "Priority",
    dataType = "enum",
    values   = {
        { value = "high",   title = "High" },
        { value = "medium", title = "Medium" },
        { value = "low",    title = "Low" },
    },
    searchable = true,
    browsable  = true,
    section    = "Organization",
},

After editing: Plug-in Manager → Disable → Enable.


Logging Configuration

Edit PluginConfig.lua:

-- "off"     — disabled (production)
-- "error"   — critical errors only
-- "warn"    — errors + warnings
-- "trace"   — full diagnostics (ExifTool commands, paths, etc.)
PluginConfig.LOG_LEVEL = "off"

Logs are saved in: ~/Documents/LrClassicLogs/


Usage

Editing Metadata

  1. Library module → Metadata panel → tagset "Custom Metadata".
  2. Fill in the fields.

Write to XMP (from menu)

  1. Select photos.
  2. Library → Plug-in Extras → Write Custom Metadata to XMP.

Write to XMP (on export)

  1. Export (Ctrl+Shift+E).
  2. Section "Custom XMP Metadata" → check the checkbox.
  3. Metadata will be embedded in the exported file.

Read from XMP to catalog

  1. Select photos with embedded/sidecar metadata.
  2. Library → Plug-in Extras → Read Custom Metadata from XMP.

XMP Namespace

URI:    http://ns.photocoder.pl/metadata/1.0/
Prefix: custmeta

Verification:

exiftool -config custom_xmp.config -XMP-custmeta:all photo.jpg

License

MIT

About

Lightroom Metadata plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages