Copy link to clipboard
Copied
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
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
...Copy link to clipboard
Copied
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.).
Copy link to clipboard
Copied
Re photo:requestJpegThumbnail issues, also see this thread: photo:requestJpegThumbnail - Just say NO!!!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now