4 Replies Latest reply on Oct 28, 2013 10:27 AM by areohbee

    batch resizing images, etc. not as an export

    victorvodka

      What I'd like to do is take all the images in a catalog, resize them into tiny thumbnails, place those thumbnails in some directory, and then FTP them to a web server.  Some of this is covered under the SDK's "export" functionality, but what I'm proposing isn't something I want to handle as an export (I don't want to do it from Lightroom's export menu).  I've looked into addDevelopPresetForPlugin and strangely I'm not seeing a provision in there for resizing an image, so clearly that system wasn't intended for resizing.  How might I proceed, what pitfalls do I face, and am I even asking the right questions?

        • 1. Re: batch resizing images, etc. not as an export
          johnrellis Most Valuable Participant

          Some of this is covered under the SDK's "export" functionality, but what I'm proposing isn't something I want to handle as an export (I don't want to do it from Lightroom's export menu).

          Two possible approaches:

           

          1. Your plugin could programmatically define a publish service, create a published collection with the desired photos, and then do an export.  I think this will give you the most control over thumbnail size and quality and over the asynchronous completion of a presumably very long-running task.

           

          2. Use photo:requestJPEGThumbnail().  But this has a number of issues;  see Rob Cole's experience:

           

          http://forums.adobe.com/message/5447360#5447360

          • 2. Re: batch resizing images, etc. not as an export
            victorvodka Level 1

            So, just to be clear, I can use the Lightroom SDK's export functionality in a plugin that is not actually an export plugin (that is, it isn't accessed through the export menu)? 

             

            My research on this subject turned up a function written by Rob Cole in the Elare framework that reads preview images from a catalog. If I can get that to work reliably, it might be the way to do this: http://forums.adobe.com/message/3948416#3948416

            • 3. Re: batch resizing images, etc. not as an export
              areohbee Level 5

              John R. Ellis wrote:

               

              1. Your plugin could programmatically define a publish service...

              Unless it needs to be a publish service, you may find it simpler to use an LrExportSession - pass photos and export settings and away ya go...

               

              John R. Ellis wrote:

               

              2. Use photo:requestJPEGThumbnail().  But this has a number of issues...

              Indeed, this function is not reliable if user is in develop module. If I remember correctly, it just won't work on a photo selected for develop. I think I discovered later that it will work on other photos in filmstrip, if not most-selected (in develop module I mean). And of course one has to wait for a fresh preview, so could take as long as an export. I wish Adobe would have made more than a half-baked implementation for this function. There are some other issues too with this function - it hangs forever if Lr needs to get in there and create the same preview before function is finished, or something like that.

               

               

              Option #3: use reverse-engineered access to preview subsystem - it works regardless of module, and is easy to get immediate preview - hard to assure a fresh one. Biggest problem is handling orientation and icc-profile and metadata if desired. See PreviewExporter for example:

               

              http://www.robcole.com/Rob/ProductsAndServices/PreviewExporterLrPlugin

               

              Rob

              • 4. Re: batch resizing images, etc. not as an export
                areohbee Level 5

                Yes, to be clear, if you want to export photos on the fly, and are willing to take the time for Lr to do all the work (re-render, orient, ... ) then look at LrExportSession. If you want thumbnails fast, tap the preview subsystem.