0 Replies Latest reply on Apr 6, 2012 9:43 PM by johnrellis

    Re: Tags as a service

    johnrellis Most Valuable Participant

      Todd asked about SDK capabilities for keywords:




      "There didn't seem to be an API to directly modify the metadata for an image."


      See LrPhoto, including the methods addKeyword(), removeKeyword(), and setRawMetadata().


      "The story we'd like to support is simply allowing a user to check a bunch of images, launch them to an external service, go back to playiing Angry Birds and have their images tagged automatically."


      Here's one way to implement that: The user selects the desired images and invokes the plugin's "send" command. The plugin uses LrHttp to send the photos to the external service.  If the service completes its actions in a short period of time (seconds), the plugin can simply wait for a reply from its HTTP request.  If the service's actions are expected to take a long time (minutes or hours), the plugin can poll the service using HTTP requests sent from a background task (e.g. every 30 seconds) that the plugin created with LrTask. The external service responds with a set of photo ids and corresponding keywords, and the plugin uses the LrPhoto methods to assign the keywords to the photos in the Lightroom catalog.