getDevelopSettings().Exposure2012 returns -999999
In my Relative adjustments plug-in I use the getDevelopSettings() to get the original values for, for example, Exposure2012.
One client had a problem and diving into this I discovered that when, for example when retrieving the Exposure setting, in some cases LR returns -99999 instead of the real values. Although, when navigating to the image, the settings in de Basic panel are correct.
This client is on LR5.
Reproduce:
- Run the test plug-in below on a large folder (> 200) with RAW files
Sometimes the error occurs direct, sometimes after applying a setting on a undeveloped image. - Otherwise
- (Create a new catalog, Best to experiment on a new catalog)
- Import 200 - 300 RAW photos
- Select them all and apply Auto-Tone to all of them (Library module & Grid) -> Right mouse click -> Develop settings -> Auto tone.
- Run the code below and see what's in the log file.
On some photos this -99999 is returned and on others not. Mostly on photos not visible on screen.
When in Develop mode, I scroll through all the photos manually, then afterwards it seems fine. Caching problem??
Questions:
- Any tips & tricks how to solve this issue?
- Did I miss some thing?
- How can I correct this behavior?
Info.lua
local info =
{
LrSdkVersion = 4.0,
LrToolkitIdentifier = 'com.LightroomStatistics.lightroom.develop.test',
LrPluginName = "Test",
LrPluginInfoUrl = 'http://www.LightroomStatistics.com/',
LrAlsoUseBuiltInTranslations = true,
VERSION = { major=0, minor=1, revision=1, build=0, },
LrHelpMenuItems = {
{
title = "List exposure setting photos",
file = "ShowSettings.lua",
},
},
}
return info
ShowSettings.lua
local LrTasks = import 'LrTasks'
local catalog = import "LrApplication".activeCatalog()
local ProgressScope = import 'LrProgressScope'
local LrDialogs = import 'LrDialogs'
local LrView = import 'LrView'
local LrPathUtils = import 'LrPathUtils'
local LrFileUtils = import 'LrFileUtils'
local logFilename = 'ExposureSettings'
local myLogger = import 'LrLogger'( logFilename )
myLogger:enable( "logfile" )
--[[--------------------------------------------------------------------------
Name emptyLogFile
Purpose Clears the existing log file.
From cookbook: http://cookbooks.adobe.com/post_Clearing_your_logfile_automatically-19677.html
----------------------------------------------------------------------------]]
function emptyLogFile()
--local myLogger = import 'LrLogger'( 'Stash' )
myLogger:disable()
logPath = LrPathUtils.child(LrPathUtils.getStandardFilePath('documents'), logFilename .. ".log")
if LrFileUtils.exists( logPath ) then
local success, reason = LrFileUtils.delete( logPath )
if not success then
logger:error("Error deleting existing logfile!" .. reason)
end
end
myLogger:enable( "logfile" )
end
--[[--------------------------------------------------------------------------
Main function
Name Select images
Purpose This plug-in will select every second photo.
The selected photo is the first photo to be selected and then every second
photo will also be selected.
Version 1.0
Developer D. Holtman
----------------------------------------------------------------------------]]
LrTasks.startAsyncTask( function()
emptyLogFile()
-- Get all the selected photos and the active photo
local cat_photos = catalog:getTargetPhotos()
local nCountSelected = #cat_photos
myLogger:info('List table develop settings')
for i, photo in ipairs(cat_photos) do
local devSettings = photo:getDevelopSettings()
local name = photo:getFormattedMetadata( "fileName" )
myLogger:info('Photo', name, devSettings.Exposure2012)
end
LrDialogs.message('Listing exposure', 'Finished')
end)