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

P: photo:getDevelopSettings() does not always return all / valid values

Explorer ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

After applying Develop Settings (either via SDK or via UI), sometimes photos are left in a state where photo:getDevelopSettings() will not give correct values for all sliders, especially Temperature and Tint. (and also the visual representation in the grid does not seem to be updated - when you scroll to the image, you see it visually update only after it has entered the viewport).

 

Simple code snippet to try for yourself:

 

 

local LrApplication = import "LrApplication"
local LrTasks = import "LrTasks"
local LrDialogs = import "LrDialogs"
local LrFunctionContext = import "LrFunctionContext"

LrTasks.startAsyncTask(function()

    local catalog = LrApplication.activeCatalog()
    local photos = catalog:getTargetPhotos()
    local badSettings = {}

    for i, photo in ipairs(photos) do
        local settings = photo:getDevelopSettings()

        local temperature = nil
        local tint = nil

        if settings.IncrementalTemperature ~= nil and settings.IncrementalTint ~= nil then
            temperature = settings.IncrementalTemperature
            tint = settings.IncrementalTint

            if temperature < -100 or temperature > 100 or tint < -100 or tint > 100 then
                badSettings[#badSettings + 1] = {photo,
                                                 "OUT OF RANGE incTemp: " .. tostring(temperature) .. " incTint: " ..
                    tostring(tint)}
            end
        elseif settings.Temperature ~= nil and settings.Tint ~= nil then
            temperature = settings.Temperature
            tint = settings.Tint

            if temperature < 2000 or temperature > 50000 or tint < -150 or tint > 150 then
                badSettings[#badSettings + 1] = {photo,
                                                 "OUT OF RANGE temp: " .. tostring(temperature) .. " tint: " ..
                    tostring(tint)}
            end
        else
            badSettings[#badSettings + 1] = {photo,
                                             "NIL temp: " .. tostring(settings.Temperature) .. " tint: " ..
                tostring(settings.Tint) .. " incTemp: " .. tostring(settings.IncrementalTemperature) .. " incTint: " ..
                tostring(settings.IncrementalTint)}
        end
    end

    if #badSettings > 0 then
        LrFunctionContext.callWithContext("CheckForBadSettings", function(context)

            local info = ""
            for i, b in ipairs(badSettings) do
                local photo = b[1]
                local reason = b[2]

                info = info .. photo:getFormattedMetadata("fileName") .. ":" .. tostring(reason) .. ", \n"
            end

            local result = LrDialogs.message("Found " .. tostring(#badSettings) .. " / " .. tostring(#photos) ..
                                                 " images bad settings", info)
        end)
    else
        LrDialogs.message("No bad settings found")
    end

end)

 

 

 

How to reproduce:

Take a catalog with multiple photos. Select more than are visible in the grid viewport (in my example i select 102 images, when the grid only shows 9). Do right click -> develop settings -> reset develop settings (or set them via photo:applyDevelopSettings()).

With the images still selected, run above code. We quite consistently get:

Found 73 / 102 images bad settings (basically all the photos outside the viewport)

If i scroll through the grid down a few images, i see them visually update and when running the code again, the number of bad images reduces by the number of images i had scrolled through.

 

Note: Instead of nil values we also encountered -999999 values in some cases.

 

Is this known/intented, and is there a way to trigger LrC to update the images via SDK? We tried photo:

requestJpegThumbnail() but this also did not consistently ensure good values.
Bug Investigating
TOPICS
SDK

Views

214

Translate

Translate

Report

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 Pinned Reply

Adobe Employee , Jan 04, 2024 Jan 04, 2024

Added ticket - updated status

Status Investigating

Votes

Translate

Translate
5 Comments
LEGEND ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

I had filed a bug report about this for LR 12.2, but my bug recipe worked correctly in LR 13.0.1, so I asked Adobe to close the bug report:

https://community.adobe.com/t5/lightroom-classic-discussions/photo-getdevelopsettings-does-not-alway... 

 

However, following your steps, I can reproduce the problem in LR 13.1 / Mac OS:

 

1. Put 200 raws in the Quick Collection and select it as the current source.

 

2. Select all the photos and do Quick Develop > Reset All.

 

3. Run your script above and observe these incorrect results:

johnrellis_0-1704331971675.png

 

4. Run the Any Filter plugin's Filter command with the single criterion Temperature and observe the same number of photos (183) with no value for Temperature:

 

johnrellis_2-1704332069827.png

5. Select all the photos and do Library > Previews > Build Standard-Sized Previews, forcing LR to re-render all the images.

 

6. Rerun the script and Any Filter and observe all photos have valid values for Temperature.

-------

 

There have been a number of similar bugs reported over the years. Internally, LR defers a lot of computation after the user applies a command to a batch of photos, and the SDK doesn't always force deferred computation when accessing develop settings.  Sometimes there are bugs with the deferred computation overwriting user-applied settings, with no plugins involved (e.g. applying Auto Settings to a batch of photos).

Votes

Translate

Translate

Report

Report
LEGEND ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

@Rikk Flohr: Photography, please consider moving to Bugs. (See my bug recipe above.)

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

Added ticket - updated status

Rikk Flohr - Customer Advocacy: Adobe Photography Products
Status Investigating

Votes

Translate

Translate

Report

Report
Participant ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

Also experiencing this behavior. Any workaround to get the correct values.
I need them for Temperature and Tint.

 

Also noticed that after Resetting the settings with <Ctrl><Shift> R a lot images report no values for Temperature and Tint.

 

Not getting the develop settings break many of the existing plug-ins!
This is a core functioanlity of the SDK

Votes

Translate

Translate

Report

Report
LEGEND ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

LATEST

The only workaround I know of is to do Library > Previews > Build Standard-Sized Previews, which forces the deferred rendering of photos with changed settings. The SDK doesn't provide any methods for doing this, unfortunately.

Votes

Translate

Translate

Report

Report