photo:getDevelopSettings() sometimes returns nil for Temperature and Tint.
There was a previous bug report filed for LR 12.2 (also observed in 10.4). The original bug recipe didn't reproduce the behavior in LR 13.0.1, so we closed the bug. But now we're observing the misbehavior again in LR 13.5.1, with a slightly different bug recipe.
1. Download and unzip this small catalog:
https://www.dropbox.com/scl/fi/nmh89jdu83e34vyhdgcj9/Temperature.2024.09.20.zip?rlkey=iib53zohs7ugef...
2. Copy the file "get-temperature.lua" from the catalog folder to the User Scripts folder.
3. Open the catalog.
4. In the Folders panel, right click the folder Temperature and do Synchronize Folder and import the one photo.
5. Select the one photo and do Scripts > get-temperature and observe the correct output:
6. Do Quick Develop > Reset All.
7. Do Scripts > get-temperature and observe the incorrect output:
8. In Quick Develop, click Exposure > Increase Exposure 1/3 Stop.
9. Do Scripts > get-temperature and observe the correct output:
* * *
I've successfully tested this workaround on about 500 photos that were originally reporting nil:
if nil == photo:getDevelopSettings ().Temperature then
photo:quickDevelopAdjustWhiteBalance ("Temperature", 0)
end
assert (nil ~= photo:getDevelopSettings ().Temperature)