1 Reply Latest reply on Apr 16, 2014 8:42 PM by areohbee

    Modifying Metadata with an Export Filter

    MunkyMorgy

      I have managed to create an export filter that modifies exportSettings shown below but is there a way to set metadata on the image, preferably on a per image basis (renditionOptions only being evaluated once), I would like to set the metadata on the generated image but on the lightroom master copy is ok. Ideally will not have to rely on external tools like exiftool.

       

      I think the commad would go in the for sourceRendition section, but not sure how you access or change the photos metadata.

       

      Thanks

       

      local function sectionForFilterInDialog( f, propertyTable )

        return {

          title = LOC "$$$/SDK/MetaExportFilter/SectionTitle=400x400 Filter",

        }

      end

       

      --------------------------------------------------------------------------------

      local function postProcessRenderedPhotos( functionContext, filterContext )

       

        local renditionOptions = {

          filterSettings = function( renditionToSatisfy, exportSettings )

            logger:info('renditionOptions'  ) 

            exportSettings.LR_size_maxHeight = 400

            exportSettings.LR_size_maxWidth  = 400

            exportSettings.LR_size_doConstrain = true

          end

        }

       

        for sourceRendition, renditionToSatisfy in filterContext:renditions( renditionOptions ) do

          -- Wait for the upstream task to finish its work on this photo.

          local success, pathOrMessage = sourceRendition:waitForRender()

        end

      end

      --------------------------------------------------------------------------------

       

      return {

        sectionForFilterInDialog  = sectionForFilterInDialog,

        postProcessRenderedPhotos = postProcessRenderedPhotos,

      }