Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there a reliable way to force LR to update its preview and/or thumbnail?

Participant ,
May 11, 2016 May 11, 2016

I'm writing a plugin that, depending on user actions, will replace an already-imported JPEG with a new one. When my code that does this runs, I can see the change immediately in the OSX Finder window. Lightroom though takes a while to reflect the change. I can't detect a pattern: sometimes just a second or two, sometimes 10 seconds, sometimes I have to move the selection to another photo and then back to the one in question. I *think* that calling photo:requestJpegThumbnail after I write the new JPEG to disk has decreased the amount of time it takes but I'm not sure.

Is there a more reliable way to kick LR into reflecting the change?

Thanks,

db

TOPICS
SDK
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 11, 2016 May 11, 2016

Two options that immediately come to mind:

1. photo:requestJpegThumbnail().  But in LR 5, it had a reputation for being unreliable; see all the posts in this thread: Lightroom SDK: photo:requestJpegThumbnail only works in Library Module. | Photoshop Family Customer Community. Haven't seen any reports for LR 6.

2.  You could try doing photo:saveMetadata() followed by photo:readMetadata () (these are undocumented: LR 5 functions, methods, and properties not in LR 4 docs ).  readMetadata() will pop u

...
Translate
LEGEND ,
May 11, 2016 May 11, 2016

Two options that immediately come to mind:

1. photo:requestJpegThumbnail().  But in LR 5, it had a reputation for being unreliable; see all the posts in this thread: Lightroom SDK: photo:requestJpegThumbnail only works in Library Module. | Photoshop Family Customer .... Haven't seen any reports for LR 6.

2.  You could try doing photo:saveMetadata() followed by photo:readMetadata () (these are undocumented: LR 5 functions, methods, and properties not in LR 4 docs ).  readMetadata() will pop up a dialog box which you can permanently dismiss by checking "Don't show again".   Note that you have to do photo:saveMetadata() first, because otherwise photo:readMetadata() could overwrite existing metadata in the catalog (e.g. keywords, captions, etc.).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 11, 2016 May 11, 2016

Re photo:requestJpegThumbnail issues, also see this thread: photo:requestJpegThumbnail - Just say NO!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2016 May 12, 2016

Thanks, John.

I've read through the threads you linked to. I think I'm in the clear on that API only working in the Library module since my plugin is invoked from the Library menu. And I don't care about colorspace issues since I'm throwing the thumbnail data away (I'm just calling the API as a way to get LR to deterministically update its own display of the thumbnail).

Based on the API's doc, I thought invoking it with an unreasonably large value for width and height (e.g. 10,000) might force LR to re-render things but it doesn't seem to be true. I wonder if the message to my plugin's users is just, "give it a minute" to see changes. It's a small plugin that I expect to share freely so I can get away with that but seems a shame.

Curious about those undocumented functions: are there arguments to them? Any unofficial doc somewhere?

Thanks,

db

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2016 May 12, 2016
LATEST
Curious about those undocumented functions: are there arguments to them? Any unofficial doc somewhere?

No documentation I'm aware of.  They take no arguments.  I use them in a private plugin used many times a week, and they seem to work fine, at least for my purposes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines