Plug-in provided SDK - Export service provider

The service definition script for an export service provider defines the hooks that your plug-in uses to extend the behavior of Lightroom's Export features. The plug-in's Info.lua file identifies this script in the LrExportServiceProvider entry.

The service definition script should return a table that contains:

  • A pair of functions that initialize and terminate your export service.
  • Settings that you define for your export service.
  • One or more items that define the desired customizations for the Export dialog. These can restrict the built-in services offered by the dialog, or customize the dialog by defining new sections.
  • A function that defines the export operation to be performed on rendered photos (required).

The FlickrExportServiceProvider.lua file of the Flickr sample plug-in provides examples of and documentation for the hooks that a plug-in must provide in order to define an export service. Lightroom expects your plug-in to define the needed callbacks and properties with the required names and syntax.

Unless otherwise noted, all of the hooks in this section are available to both Export and Publish service provider plug-ins. If your plug-in supports Lightroom's Publish feature, you should also read the API reference section publish service provider.

Summary

exportServiceProvider.endDialog( propertyTable, why )
(optional) This plug-in defined callback function is called when the user chooses a different export service provider in the Export or Publish dialog or closes the dialog.
exportServiceProvider.processRenderedPhotos( functionContext, exportContext )
(optional) This plug-in defined callback function is called for each exported photo after it is rendered by Lightroom and after all post-process actions have been applied to it.
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog.
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog.
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog, or when the destination is already selected when the dialog is invoked, (remembered from the previous export operation).
(optional) This plug-in defined callback function is called at the beginning of each export and publish session before the rendition objects are generated.
(optional) Plug-in defined value restricts the available color space choices in the Export or Publish dialogs to those named.
(optional) Plug-in defined value restricts the available file format choices in the Export or Publish dialogs to those named.
(optional) Plug-in defined value restricts the available video export preset choices in the Export or Publish dialogs to those named.
(optional, Boolean) If your plug-in allows the display of the exportLocation section, this property controls whether the item "Temporary folder" is available.
(optional, Boolean) When plug-in defined value is true, both video and still photos can be exported through this plug-in.
(optional) Plug-in defined value suppresses the named color spaces from the list of available color space choices in the Export or Publish dialogs.
(optional) Plug-in defined value suppresses the named file formats from the list of available file format choices in the Export or Publish dialogs.
(optional) Plug-in defined value suppresses the named video export preset choices from the Export or Publish dialogs.
(optional) Plug-in defined value declares which fields in your property table should be saved as part of an export preset or a publish service connection.
(optional, Boolean) Plug-in defined value is true to hide print resolution controls in the Image Sizing section of the Export or Publish dialog.
(optional) Plug-in defined value suppresses the display of the named sections in the Export or Publish dialogs.
(optional) Plug-in defined value restricts the display of sections in the Export or Publish dialog to those named.
(optional) Plug-in defined value declares whether this plug-in supports the Lightroom publish feature.

Functions

exportServiceProvider.endDialog( propertyTable, why )
(optional) This plug-in defined callback function is called when the user chooses a different export service provider in the Export or Publish dialog or closes the dialog.

This is a blocking call. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. propertyTable
(table) An observable table that contains the most recent settings for your export or publish plug-in, including both settings that you have defined and Lightroom-defined export settings
2. why
(string) The reason this function was called. One of 'ok', 'cancel', or 'changedServiceProvider'
exportServiceProvider.processRenderedPhotos( functionContext, exportContext )
(optional) This plug-in defined callback function is called for each exported photo after it is rendered by Lightroom and after all post-process actions have been applied to it. This function is responsible for transferring the image file to its destination, as defined by your plug-in. The function that you define is launched within a cooperative task that Lightroom provides. You do not need to start your own task to run this function; and in general, you should not need to start another task from within your processing function.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. functionContext
(LrFunctionContext) function context that you can use to attach clean-up behaviors to this process; this function context terminates as soon as your function exits.
2. exportContext
(LrExportContext) Information about your export settings and the photos to be published.
exportServiceProvider.sectionsForBottomOfDialog( f, propertyTable )
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog. It can create new sections that appear below all of the built-in sections in the dialog.

Your plug-in's startDialog function, if any, is called before this function is called.

This is a blocking call. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. f
(LrView.osFactory object) A view factory object
2. propertyTable
(table) An observable table that contains the most recent settings for your export or publish plug-in, including both settings that you have defined and Lightroom-defined export settings

Return value

(table) An array of dialog sections (see example code for details)
exportServiceProvider.sectionsForTopOfDialog( f, propertyTable )
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog. It can create new sections that appear above all of the built-in sections in the dialog (except for the Publish Service section in the Publish dialog, which always appears at the very top).

Your plug-in's startDialog function, if any, is called before this function is called.

This is a blocking call. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. f
(LrView.osFactory object) A view factory object.
2. propertyTable
(table) An observable table that contains the most recent settings for your export or publish plug-in, including both settings that you have defined and Lightroom-defined export settings

Return value

(table) An array of dialog sections (see example code for details)
exportServiceProvider.startDialog( propertyTable )
(optional) This plug-in defined callback function is called when the user chooses this export service provider in the Export or Publish dialog, or when the destination is already selected when the dialog is invoked, (remembered from the previous export operation).

This is a blocking call. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. propertyTable
(table) An observable table that contains the most recent settings for your export or publish plug-in, including both settings that you have defined and Lightroom-defined export settings
exportServiceProvider.updateExportSettings( exportSettings )
(optional) This plug-in defined callback function is called at the beginning of each export and publish session before the rendition objects are generated. It provides an opportunity for your plug-in to modify the export settings.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. exportSettings
(table) The current export settings.

Properties

exportServiceProvider.allowColorSpaces : (Read-Only)
(optional) Plug-in defined value restricts the available color space choices in the Export or Publish dialogs to those named. You can use either allowColorSpaces or disallowColorSpaces, but not both. If present, this should be an array containing one or more of the following strings:
  • sRGB
  • AdobeRGB
  • ProPhotoRGB

Affects the output of still photo files only, not video files. See canExportVideo.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.allowFileFormats : (Read-Only)
(optional) Plug-in defined value restricts the available file format choices in the Export or Publish dialogs to those named. You can use either allowFileFormats or disallowFileFormats, but not both. If present, this should be an array containing one or more of the following strings:
  • JPEG
  • PSD
  • TIFF
  • DNG
  • ORIGINAL

This property affects the output of still photo files only; it does not affect the output of video files. See canExportVideo.)

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.allowVideoExportPresets : (Read-Only)
(optional) Plug-in defined value restricts the available video export preset choices in the Export or Publish dialogs to those named. You can use either allowVideoExportPresets or disallowVideoExportPresets, but not both. If present, this should be an array of tables. Each sub-table must contain a 'formatID' field, which is a string specifying the video export format, and an optional 'presetName' field, which identifies a specific video export preset. The absence of the 'presetName' field will cause all presets of the format in question to be allowed. (As a special case, the string 'original' for the 'formatID' field will allow the 'Original' entry to appear in the 'Video Format' popup menu.) The objects representing available video export presets can be obtained via LrExportSettings.videoExportPresets. Then, in turn, the name string for each preset can be retrieved via a call to each object's name function, and the format ID can be obtained via a call to the formatID function.

This property affects the output of video files only; it does not affect the output of still photo files. See canExportVideo.

First supported in version 4.0 of the Lightroom SDK.

exportServiceProvider.canExportToTemporaryLocation : (Read-Only)
(optional, Boolean) If your plug-in allows the display of the exportLocation section, this property controls whether the item "Temporary folder" is available. If the user selects this option, the files are rendered into a temporary location on the hard drive, which is deleted when the export finished.

If your plug-in hides the exportLocation section, this temporary location behavior is always used.

exportServiceProvider.canExportVideo : (Read-Only)
(optional, Boolean) When plug-in defined value is true, both video and still photos can be exported through this plug-in. If not present or set to false, video files cannot be exported through this plug-in. If set to the string "only", video files can be exported, but not still photos.

First supported in version 3.0 of the Lightroom SDK.

exportServiceProvider.disallowColorSpaces : (Read-Only)
(optional) Plug-in defined value suppresses the named color spaces from the list of available color space choices in the Export or Publish dialogs. You can use either allowColorSpaces or disallowColorSpaces, but not both. If present, this should be an array containing one or more of the following strings:
  • sRGB
  • AdobeRGB
  • ProPhotoRGB

Affects the output of still photo files only, not video files. See canExportVideo.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.disallowFileFormats : (Read-Only)
(optional) Plug-in defined value suppresses the named file formats from the list of available file format choices in the Export or Publish dialogs. You can use either allowFileFormats or disallowFileFormats, but not both. If present, this should be an array containing one or more of the following strings:
  • JPEG
  • PSD
  • TIFF
  • DNG
  • ORIGINAL

Affects the output of still photo files only, not video files. See canExportVideo.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.disallowVideoExportPresets : (Read-Only)
(optional) Plug-in defined value suppresses the named video export preset choices from the Export or Publish dialogs. You can use either allowVideoExportPresets or disallowVideoExportPresets, but not both. If present, this should be an array of tables. Each sub-table must contain a 'formatID' field, which is a string specifying the video export format, and an optional 'presetName' field, which identifies a specific video export preset. The absence of the 'presetName' field will cause all presets of the format in question to be disallowed. (As a special case, the string 'original' for the 'formatID' field will cause the 'Original' entry to be absent in the 'Video Format' popup menu.) The objects representing available video export presets can be obtained via LrExportSettings.videoExportPresets. Then, in turn, the name string for each preset can be retrieved via a call to each object's name function, or the format ID can be obtained via a call to the formatID function.

This property affects the output of video files only; it does not affect the output of still photo files. See canExportVideo.

First supported in version 4.0 of the Lightroom SDK.

exportServiceProvider.exportPresetFields : (Read-Only)
(optional) Plug-in defined value declares which fields in your property table should be saved as part of an export preset or a publish service connection. If present, should contain an array of items with key and default values. For example:
 exportPresetFields = {
    { key = 'nsid', default = "" },
    { key = 'privacy', default = 'public' },
    { key = 'privacy_family', default = false },
    { key = 'privacy_friends', default = false },
}

The key item should match the values used by your user interface controls.

The default item is the value to the first time your plug-in is selected in the Export or Publish dialog. On second and subsequent activations, the values chosen by the user in the previous session are used.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.hidePrintResolution : (Read-Only)
(optional, Boolean) Plug-in defined value is true to hide print resolution controls in the Image Sizing section of the Export or Publish dialog. (Recommended when uploading to most web services.)

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.hideSections : (Read-Only)
(optional) Plug-in defined value suppresses the display of the named sections in the Export or Publish dialogs. You can use either hideSections or showSections, but not both. If present, this should be an array containing one or more of the following strings:
  • exportLocation
  • fileNaming
  • fileSettings
  • imageSettings
  • outputSharpening
  • metadata
  • watermarking
  • video

You cannot suppress display of the "Connection Name" section in the Publish Manager dialog.

If you suppress the "exportLocation" section, the files are rendered into a temporary folder which is deleted immediately after the Export operation completes.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.showSections : (Read-Only)
(optional) Plug-in defined value restricts the display of sections in the Export or Publish dialog to those named. You can use either hideSections or showSections, but not both. If present, this should be an array containing one or more of the following strings:
  • exportLocation
  • fileNaming
  • fileSettings
  • imageSettings
  • outputSharpening
  • metadata
  • watermarking
  • video

You cannot suppress display of the "Connection Name" section in the Publish Manager dialog.

If you suppress the "exportLocation" section, the files are rendered into a temporary folder which is deleted immediately after the Export operation completes.

First supported in version 1.3 of the Lightroom SDK.

exportServiceProvider.supportsIncrementalPublish : (Read-Only)
(optional) Plug-in defined value declares whether this plug-in supports the Lightroom publish feature. If not present, this plug-in is available in Export only. When true, this plug-in can be used for both Export and Publish. When set to the string "only", the plug-in is visible only in Publish.