3 Replies Latest reply on Mar 26, 2014 6:35 AM by areohbee

    Problem with requestJpegThumbnail()

    DonCristobal Level 1


      in the LR SDK 5 there is a function called LrPhoto:requestJpegThumbnail() to request a Jpeg thumbnail for a given photo in the catalog. I have come across the following problematic behavior, and wonder if this is more of a feature, or possibly a bug...

      - I call requestJpegThumbnail() with size parameters and a callback. Let's say I request a thumbnail with 1080x720. The following is for Canon RAW (.CR2) images.

      - When I execute my plugin from the Library module, everything works as intended. The callback is called and gives me a thumbnail which has dimensions which are slightly larger than the requested dimensions (in line with the documentation, which says "Request sizes are treated as minimums; the preview that is returned may be larger.") Execution is quick.

      - However, when I execute my plugin from the Develop module, I always receive a "thumbnail" which has the original photo size of 3840x5760. Since the original photo is a 30MB RAW (5d3) file, it takes a while for the "thumbnail" to be generated, which slows down processing considerably. 

      I don't quite understand why LR, when in Develop module, should not have available anymore the smaller thumbnail which it seconds before still had available in the Library module.

      - More often than not, when executed from Develop module, I also receive a second call to my callback, delivering me once again the 3840x5760 image, slowing down processing even more. I could not reproduce exactly under which circumstances the callback is called again. I use code to detect this condition and to ignore the second thumbnail, but I still lose another 2-3 seconds while the image is being generated. Is this a known problem?

      - All of this is on Mac OSX 10.9.2., LR 5.3.


      Some other questions:

      - Is it possible to set the position of the floating dialog in LrDialogs?

      - I am considering whether I should do a LR4-compatible-version of my plugin, i.e. circumventing the requestJpegThumbnail() call. Can you give some rough estimate on what percentage of users still use LR4?


      Many thanks


        • 1. Re: Problem with requestJpegThumbnail()
          areohbee Level 6

          On my win7 machine, requestJpegThumbnail is unusable when Lr is in develop module - see my post #20:




          PS - I couldn't give percent of users using Lr4 vs. 5, but it's substantial, although a minority, for whatever that's worth.


          Regarding floating dialogs, if you pass save_frame = {some-key} it'll remember where the user put it, dunno if it's possible to set position programmatically via plugin (I dont think so, or at least not via some direct, straight-forward means, e.g. SDK..).


          requestJpegThumbnail was a big disappointment for me - yet another Lr5 method where the big print giveth, but the small print taketh away - I don't believe Adobe put their best effort into SDK 5 - some of the best new functions turned out to be module-sensitive, with no way to determine or control module - ugh..




          • 2. Re: Problem with requestJpegThumbnail()
            DonCristobal Level 1

            Hi Rob,

            thank you, that's helpful. I was aware of your earlier message regarding requestJpegThumbnail, but since it was posted at a time when LR5 was still very fresh, I thought this behavior would maybe have been fixed by now. Is it still the same in Win7? If so, I think I will simply limit my plugin to Library module.

            Is there a recommended official place for posting bug reports for LR (and is it worthwhile doing in your experience, i.e. is there a good chance for follow-up... )?


            With the floating dialog, I am aware of the save_frame option, but that doesn't solve my problem, I have a floating dialog which shows an image in either portrait or landscape mode and I want it to be centered horizontally in the middle of the screen, i.e. different upper left coordinates based on landscape or portrait mode, whereas save_frame just saves the upper left coordinates. But, it's not a big deal if it's not possible, thanks for your reply and also your assessment regarding LR4/5.



            • 3. Re: Problem with requestJpegThumbnail()
              areohbee Level 6

              DonCristobal wrote:


              it was posted at a time when LR5 was still very fresh...

              @v5.2 - nothing had changed SDK-wise (not sure if I checked v5.3 or not, but nothing was mentioned in release notes, nor feedback forum - my guess: no change).


              My experience: Adobe fixes very few of the total reported, whether many of those reported would be fixable in a heart-beat or not. But if you wanna try your luck:


              http://feedback.photoshop.com/photoshop_family/products/photoshop_family_photoshop_lightro om