File LrMetadata.lua

Functions

Cache:addFormattedMetadata (photos, names) Add raw metadata to cache - note: photos may be different, caller of get-raw-metadata beware.
Cache:addRawMetadata (photos, names) Add raw metadata to cache - note: photos may be different, caller of get-raw-metadata beware.
Cache:getFmtMeta () Get formatted metadata table - for legacy methods that still require separate, raw-meta and fmt-meta tables.
Cache:getFormattedMetadata (photo, name, acceptUncached, rejectNil) Get specified formatted metadata, hopefully from cache.
Cache:getRawMeta () Get raw metadata table - for legacy methods that still require separate, raw-meta and fmt-meta tables.
Cache:getRawMetadata (photo, name, acceptUncached, rejectNil) Get specified raw metadata, hopefully from cache.
Cache:loadFormattedMetadata (photos, names) Assure specified formatted metadata is in cache for short-term future use.
Cache:loadRawMetadata (photos, names) Cache specified raw metadata for short-term future use.
Cache:new (t) Constructor for new instance.
LrMetadata:createCache (t) Create metadata cache for local use.
LrMetadata:defineTokens (params) Display dialog box for defining tokens.
LrMetadata:getFmtGetPopupItems (params) Get gettable formatted items suitable for popup menu.
LrMetadata:getHelpText (params) Get list of metadata items for printing or clipboard..
LrMetadata:getPopupItems () Get gettable raw items suitable for popup menu.
LrMetadata:getRawGetPopupItems (params) Get gettable raw items suitable for popup menu.
LrMetadata:getRawMetadata (photo, name, cache) Get specified raw metadata, from cache if available.
LrMetadata:getRawSetPopupItems (params) Get settable raw items suitable for popup menu.
LrMetadata:init () Initialize data descriptors for getting/setting raw/formatted Lightroom metadata.
LrMetadata:isKnownKey (photo, name) Determine if key is known in formatted metadata.
LrMetadata:isKnownRawKey (photo, name) Determine if key is valid for reading raw metadata.
LrMetadata:isSettableRawKey (name) Determine if key is valid for setting raw metadata.
LrMetadata:new (t) Constructor for new instance.
LrMetadata:newClass (t) Constructor for extending class.
LrMetadata:transfer (params) Transfer metadata from photo (possibly missing) to photo (presumably file must exist, unless inclusions/exclusions carefully chosen).


Functions

Cache:addFormattedMetadata (photos, names)
Add raw metadata to cache - note: photos may be different, caller of get-raw-metadata beware.

Parameters:

  • photos:
  • names:
Cache:addRawMetadata (photos, names)
Add raw metadata to cache - note: photos may be different, caller of get-raw-metadata beware.

Parameters:

  • photos:
  • names:
Cache:getFmtMeta ()
Get formatted metadata table - for legacy methods that still require separate, raw-meta and fmt-meta tables.
Cache:getFormattedMetadata (photo, name, acceptUncached, rejectNil)
Get specified formatted metadata, hopefully from cache.

Parameters:

  • photo:
  • name:
  • acceptUncached:
  • rejectNil:

Usage:

    Enable advanced debugging for this module to see uncached metadata accesses. 
Cache:getRawMeta ()
Get raw metadata table - for legacy methods that still require separate, raw-meta and fmt-meta tables.
Cache:getRawMetadata (photo, name, acceptUncached, rejectNil)
Get specified raw metadata, hopefully from cache.

Parameters:

  • photo:
  • name:
  • acceptUncached:
  • rejectNil:

Usage:

    Enable advanced debugging for this module to see uncached metadata accesses. 
Cache:loadFormattedMetadata (photos, names)
Assure specified formatted metadata is in cache for short-term future use.

Parameters:

  • photos:
  • names:

Usage:

    @10/Jul/2012 15:51, clears any previous metadata from cache - original intention was to add-to, but that hasn't happened yet. 
Cache:loadRawMetadata (photos, names)
Cache specified raw metadata for short-term future use.

Parameters:

  • photos:
  • names:

Usage:

    @10/Jul/2012 15:51, clears any previous metadata from cache - original intention was to add-to, but that hasn't happened yet. 
Cache:new (t)
Constructor for new instance.

Parameters:

  • t:

Usage:

    presently no way to extend internal cache class.
    if that changes, then provide new class constructor and go through object factory to create.
LrMetadata:createCache (t)
Create metadata cache for local use.

Parameters:

  • t: (table, optional) members: photos, rawIds, fmtIds. If provided cache will be pre-loaded.
LrMetadata:defineTokens (params)
Display dialog box for defining tokens.

Parameters:

  • params:

Usage:

  • asynchronous (optional callbacks).
  • params may include callbacks as defined in show-floating-dialog method.
  • if more than one simultaneous, pass unique titles, since they're used for guarding. 
LrMetadata:getFmtGetPopupItems (params)
Get gettable formatted items suitable for popup menu.

Parameters:

  • params:
LrMetadata:getHelpText (params)
Get list of metadata items for printing or clipboard..

Parameters:

  • params:
LrMetadata:getPopupItems ()
Get gettable raw items suitable for popup menu. [[ *** on hold - needs more thought..
LrMetadata:getRawGetPopupItems (params)
Get gettable raw items suitable for popup menu.

Parameters:

  • params:
LrMetadata:getRawMetadata (photo, name, cache)
Get specified raw metadata, from cache if available.

Parameters:

  • photo:
  • name:
  • cache:

Usage:

    good for functions that can take advantage of a cache created externally, or not. 
LrMetadata:getRawSetPopupItems (params)
Get settable raw items suitable for popup menu.

Parameters:

  • params:
LrMetadata:init ()
Initialize data descriptors for getting/setting raw/formatted Lightroom metadata.

Usage:

    called automatically if need be, but feel free to call upon plugin init for faster initial on-demand response. 
LrMetadata:isKnownKey (photo, name)
Determine if key is known in formatted metadata.

Parameters:

  • photo:
  • name:
LrMetadata:isKnownRawKey (photo, name)
Determine if key is valid for reading raw metadata.

Parameters:

  • photo: (LrPhoto, optional) test photo.
  • name: (string, required) key.
LrMetadata:isSettableRawKey (name)
Determine if key is valid for setting raw metadata.

Parameters:

  • name:
LrMetadata:new (t)
Constructor for new instance.

Parameters:

  • t:
LrMetadata:newClass (t)
Constructor for extending class.

Parameters:

  • t:
LrMetadata:transfer (params)
Transfer metadata from photo (possibly missing) to photo (presumably file must exist, unless inclusions/exclusions carefully chosen).

Parameters:

  • params: (table) required. elements:
    fromPhoto (LrPhoto, required) source of metadata (from catalog only). toPhoto (LrPhoto, required) target of metadata (catalog and maybe file too). inclusions (table, optional, but recommended) set (or array) of metadata names to include. exclusions (table, optional, usually omitted) set (or array) of metadata names to exclude. toIsVirginal (boolean, default = false) if true, blank from items will be ignored. exifToolSession (object) - in case included items will require exiftool to transfer.

Usage:

    Initially used for transferring metadata from missing photo to recovered preview. 

Valid XHTML 1.0!