6 Replies Latest reply on Mar 23, 2011 9:56 AM by johnrellis

    API feature requests

    alex krylov Level 1

      My list of wishes for future Lr API.

      I'm just a week in plug-ins developement. Maybe there are ways to achieve these tasks still hidden from me, so consider it as novice's point of view.

       

      Catalog

      1. Move photos in catalog from one location to another, maintaining metadata both in DB and XMP. Something like LrPhoto:move(). Why: some tasks require relocation of the photos, but at the present time there are no clear way to do it.

      2. Stacking/unstacking photos. Why: as example, I made plugin, grouping burst-shooted images, with delay between shoots less than a second. Lr does not allow to setup autostack for fraction of seconds, but plugin can do it. If the proper API routine will be provided.

      3. Accsess to full raw image metadata, both read and write. Why: for a lots of exif-related tasks I have to use exiftool. It's excelent, but it is external call, with slowdowns and other drawbacks. Not mentioning DB sync issues.

      4. Sync metadata. Why: if I do something whith photo's exif, I defenitely wish to populate changes to DB.

      5. Remove photo from catalog. I can remove it from disk, but it leaves the "ghost" in catalog. So why don't allow to delete it as well? At least let us mark photo as "rejected".

       

       

      Tasks

      1. Ability to group together import tasks, so user don't get tired of numerous exclamination sounds when lots of photos are imported by plugin. Why: it's obvious.

       

      Interface

      1. Rich text in dialogs, maybe HTML. Why: it will allow us to create more user-friendly and nice interface for plug-ins.

       

      Developement and Info

      1. More, more code examples in API Reference! Some things are really not so obvious.

      2. Debugger with integrated data structures browser. John R. Ellis did a great job with his Debugging Toolkit, but there are lots of things you can do only with help of application core.

       

       

      p.s. I've submitted all of this to «feature requests».

       

      Alex

        • 1. Re: API feature requests
          areohbee Level 5

          +1 vote, except I didnt understand about the "exclamination sounds" - is that a Mac thing?

           

          Hi Alex,

           

          I'm presently working on a sidekick app / plugin combo, a.k.a. a distributed plugin (communication via xmlrpc, app accesses lr-previews...). The most recent change I made was to be able to commit database changes to lrcat directly by automatically closing Lightroom, using sql via python script (app side), then restarting Lightroom. Its messy, but is one way to delete photos, do instant imports, update metadata, rearrange stacks... If you did not want to go whole hog with the sidekick, you could still borrow some of the concepts. For example:

           

          - Have your plugin write the SQL needed to make the changes, or just save instructions in non-SQL form.

          - then have a simple script which submits the SQL to the lrcat, but first loops while polling for Lightroom to free up the database.

          - Start that script via plugin.

          - Kill Lightroom by LrTask.execute-ing a kill command.

          - The script, after detecting the database is free, can then update the database, and restart Lightroom.

           

          Using this technique a plugin essentially has complete access to the lrcat database, albeit not exactly seamless.

           

          You can experiment on a test catalog to get your SQL together before embedding in plugin/script - the database is quite easy to figure out if you are willing to spend a few hours with an sql client app...

           

          Rob

          1 person found this helpful
          • 2. Re: API feature requests
            alex krylov Level 1

            Hi, Rob,

             

            Thanks for sharing valuable ideas. Yesterday I finnally faced with the need of SQLing. And I'm still struggling with it. By any chance, do you know how to stack images with SQL? I tried to meddle to "Adobe_images" table, but all what I got is empty cell in Grid in place where the stacked image should be.

             

            p.s. «Exclamination sounds» — I mean audiable notification when importing task is done. If my plugin imports 10 images with catalog:AddPhoto(), I get 10 consecutive «beep» sounds. Maybe there is workaround?

             

            Alex

             

            p.s. Of cource good API should eluminate the need of all these kluges.

            • 3. Re: API feature requests
              areohbee Level 5

              No idea how to do stacking via SQL, but one way to reverse engineer, is to query the database before stacking, then again after, and compare the difference.

              • 4. Re: API feature requests
                johnrellis Most Valuable Participant
                Stacking/unstacking photos. Why: as example, I made plugin, grouping burst-shooted images, with delay between shoots less than a second. Lr does not allow to setup autostack for fraction of seconds, but plugin can do it. If the proper API routine will be provided.

                Do you know that catalog:addPhoto() can stack photos?  I've used it, and it works as advertised (though it fails silently if you try to stack photos in different folders).  It may not completely satisfy your need, since it only lets you stack when you add the photo to the catalog.

                • 5. Re: API feature requests
                  alex krylov Level 1

                  Yes, but it stack only newly added photos, isn't it? I'm using the catalog:addPhoto() call after moving photo, but it doesn't seem nice.

                  • 6. Re: API feature requests
                    johnrellis Most Valuable Participant
                    Yes, but it stack only newly added photos, isn't it?

                    Right, it will only stack the photos that are also being added to the catalog.