Adobe 65007312 Programming Guide - Page 49
Stage 1: Deciding how the photos should be rendered, Stage 3: Requesting renditions, The service's
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 49 highlights
CHAPTER 3: Creating Export and Publish Services Adding an export post-process action 49 It then calls exportSession:doExportOnCurrentTask(), which performs the following operations. (If you wish to start an export without using the export dialog, you can make the same calls yourself.) In this discussion, an Export Service Provider is called a service, and an Export Filter Provider is called a filter. Stage 1: Deciding how the photos should be rendered If the service has defined an updateExportSettings() function, it is called. This function takes one argument, the export-settings table, and allows the service to force certain render settings to its preferred or required settings. For example, to force a specific size for the exported photos, you could use this definition: updateExportSettings = function( exportSettings ) exportSettings.LR_size_maxHeight = 400 exportSettings.LR_size_maxWidth = 400 end The filters, if any, are not involved at this stage. Stage 2: Deciding what photos should be rendered The filters are invoked from top-to-bottom. For each filter: X If it is defined, the shouldRenderPhotos() function is called for each photo. If it returns false, the photo is removed from the list of photos to export (and thus does not get passed to the downstream consumer). If it returns true, the photo remains in the list and is passed to the downstream consumer. X If shouldRenderPhotos() is not defined for the filter, all photos are passed to the downstream consumer. Stage 3: Requesting renditions 1. The export session (LrExportSession) generates rendition request objects (LrExportRendition) for every photo that was not removed in Stage 2. (The actual rendering of the photos does not start yet.) During this stage, Lightroom can show a dialog message if a photo already exists at the proposed destination location. You can control this behavior using the LR_collisionHandling setting in the export settings table. 2. The service's processRenderedPhotos() function is called. If no such function exists, a default one is provided that performs the steps described below. IMPORTANT: Each of the providers (the export service, filters, and Lightroom's built-in rendering engine) runs in its own task (using LrTasks), so these loops operate in parallel. It is likely that each provider will be running simultaneously. Several photos can be in process simultaneously by different providers. This allows the overall export operation to complete much more quickly than it would if every photo had to go through all of the steps before the processing of the next photo could begin. 3. The processRenderedPhotos() function calls exportContext:renditions() and then waits for each rendition to be completed by calling rendition:waitForRender(). (We will discuss the completion of this loop in Stage 4.) 4. The service's rendition requests are sent to its upstream provider (that is, the bottom-most filter, or if there are no filters, Lightroom's built-in render engine).