Skip to main content
Known Participant
October 23, 2024

P: Cannot turn off max compatibility programmatically in LrExportSettings

  • October 23, 2024
  • 2 replies
  • 922 views

Version: 14.0.1

Platform and OS Version: Windows 11 Pro 23H2

 

When exporting an HDR image from a plugin, one cannot turn off the maximum compatibility setting.  This results in overly large files that are not yet widely processed correctly.

 

The following creates a minimal (?) plugin that reproduces the problem.

 

Expected: two exports are created, one with maximum compatibility off ("normal" HDR render) and one with maximum compatibility on (SDR + gainmap(?) render).

Actual: two identical files are rendered.

 

Info.lua:

 

 

 

 

 

 

 

return {
  LrSdkVersion = 14.0,

  -- 13.0: HDR settings
  LrSdkMinimumVersion = 13.0, -- minimum SDK version required by this plug-in
  LrToolkitIdentifier = "name.stolle.martin.max_compat_repro",
  LrPluginName = LOC "$$$/PluginName=Max Compat Repro Plugin",

  -- Add the menu item to the Library menu.
  LrLibraryMenuItems = {
    {
      title = LOC "$$$/CreateNew=Trigger",
      file = "Trigger.lua",
    },
  },

  VERSION = { major=1, minor=1, revision=0, build=200000, },
}

 

 

 

 

 

 

 

 

Trigger.lua:

 

 

 

 

 

 

 

local LrApplication = import 'LrApplication'
local LrDialogs = import 'LrDialogs'
local LrExportSession = import 'LrExportSession'
local LrFunctionContext = import 'LrFunctionContext'
local LrFileUtils = import 'LrFileUtils'
local LrPathUtils = import 'LrPathUtils'
local LrProgressScope = import 'LrProgressScope'
local LrTasks = import 'LrTasks'

local function trigger(functionContext)
  LrDialogs.attachErrorDialogToFunctionContext(functionContext)
  local catalog = LrApplication.activeCatalog()
  local photo = catalog:getTargetPhoto()

  if photo:getDevelopSettings()["HDREditMode"] == null then
    LrDialogs.message( "Photo not HDR", "Please select an HDR photo.", "warn")
  end

  tempDir = os.tmpname()
  LrFileUtils.createDirectory(tempDir)

  local exportSettings = {
    LR_format = 'TIFF',
    LR_export_destinationType = 'tempFolder',
    LR_export_destinationPathPrefix = tempDir,
    LR_export_useSubfolder = false,
    LR_collisionHandling = 'overwrite',
    LR_renamingTokensOn = true,
    LR_extensionCase= 'lowercase',
    LR_export_colorSpace = 'Rec2020_hdr',
    LR_export_bitDepth = 32,
    LR_enableHDRDisplay = true,
  }

  exportSettings["LR_maximumCompatibility"] = false
  exportSettings["LR_tokens"] = "maxCompat_off"
  local exportSession = LrExportSession({
    photosToExport = {photo},
    exportSettings = exportSettings
  })
  exportSession:doExportOnCurrentTask()

  exportSettings["LR_maximumCompatibility"] = true
  exportSettings["LR_tokens"] = "maxCompat_on"
  local exportSession = LrExportSession({
    photosToExport = {photo},
    exportSettings = exportSettings
  })
  exportSession:doExportOnCurrentTask()

  LrDialogs.message( "Done", "Exported to " .. tempDir)
end

local function main() 
  local catalog = LrApplication.activeCatalog()

  if catalog:getTargetPhoto() == nil then
    LrDialogs.message( "No Photo selected", "No photo was selected.  Please select a photo first.", "warn")
  end
  LrFunctionContext.postAsyncTaskWithContext("trigger", trigger)
end

main()

 

 

 

 

 

 

 

 

 

This topic has been closed for replies.

2 replies

Rikk Flohr_Photography
Community Manager
Community Manager
December 12, 2024

Greetings all, 

 

A new update for Adobe Photography Products has been released.  The December update contains an update for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for being so patient.

Rikk Flohr: Adobe Photography Org
Rikk Flohr_Photography
Community Manager
Community Manager
October 24, 2024

Link to existing internal bug. 
Updating Status

Rikk Flohr: Adobe Photography Org