Skip to main content
C.Cella
Inspiring
April 3, 2024
Answered

Problem with photo:applyDevelopSettings()

  • April 3, 2024
  • 1 reply
  • 529 views

I have a problem with the API photo:applyDevelopSettings()

 

For reason beyond my understanding photo:applyDevelopSettings()  dos not work for all the settings I write

 

 

local catalog = import "LrApplication".activeCatalog ()
local photo = catalog:getTargetPhoto ()
import "LrTasks".startAsyncTask (function ()
    catalog:withWriteAccessDo ("Test Settings", function ()
        photo:applyDevelopSettings { HDREditMode = 1}
        end)
    end)

   

 

 

If I write instead any another setting or add after HDREditMode nothing works

 

I am totally lost here.

 

 

 

 

 

This topic has been closed for replies.
Correct answer johnrellis

Make sure you're using Clarity2012 -- Clarity is for the very old process versions. In general, you can copy individual values from the Show Metadata plugin, e.g.

local catalog = import "LrApplication".activeCatalog ()
local photo = catalog:getTargetPhoto ()
import "LrTasks".startAsyncTask (function ()
    catalog:withWriteAccessDo ("Test Settings", function ()
        photo:applyDevelopSettings {ExtendedToneCurvePV2012 = {--table: 2
        [1] = 0, 
        [2] = 0, 
        [3] = 84, 
        [4] = 68, 
        [5] = 130, 
        [6] = 147, 
        [7] = 183, 
        [8] = 193, 
        [9] = 255, 
        [10] = 255}}
        end)
    end)

 

1 reply

johnrellis
Genius
April 3, 2024

What did you try? The following works:

 

local catalog = import "LrApplication".activeCatalog ()
local photo = catalog:getTargetPhoto ()
import "LrTasks".startAsyncTask (function ()
    catalog:withWriteAccessDo ("Test Settings", function ()
        photo:applyDevelopSettings { HDREditMode = 1, Exposure2012 = 4}
        end)
    end)

 

C.Cella
C.CellaAuthor
Inspiring
April 3, 2024

@johnrellis 

 

Clarity doesn't work

 

I tried also with ExtendedToneCurvePV2012 but is not working.

johnrellis
johnrellisCorrect answer
Genius
April 3, 2024

Make sure you're using Clarity2012 -- Clarity is for the very old process versions. In general, you can copy individual values from the Show Metadata plugin, e.g.

local catalog = import "LrApplication".activeCatalog ()
local photo = catalog:getTargetPhoto ()
import "LrTasks".startAsyncTask (function ()
    catalog:withWriteAccessDo ("Test Settings", function ()
        photo:applyDevelopSettings {ExtendedToneCurvePV2012 = {--table: 2
        [1] = 0, 
        [2] = 0, 
        [3] = 84, 
        [4] = 68, 
        [5] = 130, 
        [6] = 147, 
        [7] = 183, 
        [8] = 193, 
        [9] = 255, 
        [10] = 255}}
        end)
    end)