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()