Skip to main content
Known Participant
October 20, 2024
Answered

Turning off "Maximize Compatibility" through the SDK

  • October 20, 2024
  • 1 reply
  • 678 views

Is there any way to turn off "maximize compatibility" when using the SDK to render an image?  I created a plugin that renders image as part of generating panormas with PtGui, and since the latest update (14.0 or 14.0.1), TIFFs rendered through an LrExportSession created programmatically have changed to behave like "maximize compatibility" is turned on, which breaks (see my other post).  I have inspected the exportSettings of manual exports with and without "maximize compatibility" turned on, and I cannot find any property that changes.

 

Is this a known issue? Anyone know of any potential workarounds?

This topic has been closed for replies.
Correct answer johnrellis

It's entirely possible it's a bug. Export of HDR images was added relatively recently, and the team may have forgotten to update the SDK support appropriately (which often occurs).  

 

Unless you provide a packaged-up easy way to reproduce a problem, Adobe isn't likely to pay much attention. See here for an example of how I submit SDK bugs in a way that makes it possible for anyone to reproduce the issue:

https://community.adobe.com/t5/lightroom-classic-bugs/p-sdk-method-exportrendition-waitforrender-returns-incorrect-results-for-videos/idi-p/14929458

1 reply

johnrellis
Legend
October 22, 2024

I made Export presets with and without TIFF Maximize Compatibility checked, and comparing the two presets' .lrtemplate files, it appears that the setting is named:

 

LR_maximumCompatibility = false,

 

 

Known Participant
October 23, 2024

Ah, neat. I didn't realize that the presets are stored in easy to inspect files.  I was inspecting the table passed to an export filter plugin, where the setting does not appear. I can confirm your observation on the preset files.

 

Unfortunately, there still seems to be a problem setting it from a plugin.  I am now setting that key in the settings table:

 

function PtExport.export(photos)
  tempDir = os.tmpname()

  if #photos < 1 then
    return tempDir, {}
  end

  local isHdr = nil
  for _, photo in ipairs(photos) do
    local otherHdr = photo:getDevelopSettings()["HDREditMode"]
    if (isHdr == nil and otherHdr ~= nil)
        or (otherHdr ~= nil and otherHdr > isHdr) then
      isHdr = otherHdr
    end
  end
  
  local exportSettings = {
    LR_format = 'TIFF',
    LR_export_destinationType = 'tempFolder',
    LR_export_destinationPathPrefix = tempDir,
    LR_export_useSubfolder = false,
    LR_collisionHandling = 'overwrite',
    LR_renamingTokensOn = true,
    LR_tokens = '{{naming_operationSequence_5Digits}}',
    LR_extensionCase= 'lowercase',
  }

  if isHdr then
    exportSettings["LR_export_colorSpace"] = 'Rec2020_hdr'
    exportSettings["LR_export_bitDepth"] = 32
    exportSettings["LR_enableHDRDisplay"] = true
    exportSettings["LR_maximumCompatibility"] = false
  else
    exportSettings["LR_export_colorSpace"] = 'ProPhotoRGB'
    exportSettings["LR_export_bitDepth"] = 16
  end

  LrFileUtils.createDirectory(tempDir)

  -- Confirm the settings
  local file = io.open(tempDir .. "\\settings.txt", "w")
  if file then
    file:write(PtUtils.dump(exportSettings))
    file:close()
  else
    LrDialogs.message("Write Failure", tempDir)
  end


  local exportSession = LrExportSession({
    photosToExport = photos,
    exportSettings = exportSettings
  })
  exportSession:doExportOnCurrentTask()

  local outputFilenames = {}
  for i, rendition in exportSession:renditions() do
    outputFilenames[i] = rendition.destinationPath
  end
 
  return tempDir, outputFilenames
end

 

But it seems to be ignored.  I double checked the contents of the table:

 

$table: 000000034704FE90$ {
[LR_collisionHandling] = overwrite,
[LR_extensionCase] = lowercase,
[LR_export_useSubfolder] = false,
[LR_maximumCompatibility] = false,
[LR_tokens] = {{naming_operationSequence_5Digits}},
[LR_export_colorSpace] = Rec2020_hdr,
[LR_enableHDRDisplay] = true,
[LR_export_bitDepth] = 32,
[LR_export_destinationPathPrefix] = C:\Users\m_sto\AppData\Local\Temp\LR-11,
[LR_renamingTokensOn] = true,
[LR_format] = TIFF,
[LR_export_destinationType] = tempFolder,
} 

 

Anything I am doing wrong? Or a bug in Lightroom?

 

Martin

johnrellis
johnrellisCorrect answer
Legend
October 23, 2024

It's entirely possible it's a bug. Export of HDR images was added relatively recently, and the team may have forgotten to update the SDK support appropriately (which often occurs).  

 

Unless you provide a packaged-up easy way to reproduce a problem, Adobe isn't likely to pay much attention. See here for an example of how I submit SDK bugs in a way that makes it possible for anyone to reproduce the issue:

https://community.adobe.com/t5/lightroom-classic-bugs/p-sdk-method-exportrendition-waitforrender-returns-incorrect-results-for-videos/idi-p/14929458