(API) Difference between CropAngle and straightenAngle?
Hello everyone,
I try to crop and straighten images with the Lua SDK.
This is the code:
if LrApplicationView.getCurrentModuleName() == "develop" and photo == catalog:getTargetPhoto() then
LrDevelopController.setValue("CropLeft", cropLeft)
LrDevelopController.setValue("CropRight", cropRight)
LrDevelopController.setValue("CropTop", cropTop)
LrDevelopController.setValue("CropBottom", cropBottom)
LrDevelopController.setValue("straightenAngle", angle)
LrDevelopController.setValue("CropConstrainAspectRatio", aspectRatio)
else
local settings = {}
settings.CropLeft = cropLeft
settings.CropRight = cropRight
settings.CropTop = cropTop
settings.CropBottom = cropBottom
settings.CropAngle = -angle
settings.CropConstrainAspectRatio = aspectRatio
photo:applyDevelopSettings(settings)
end
The weird thing is that I am getting two different results. When the first if-statement is true the script works fine and the output is as desired: The image was cropped by the calculated values and the angle was corrected while maintaining the desired aspect ratio.
But in the second if-statement the result is different. The image was cropped by the calculated values, but the angle correction changed the desired aspect ratio. Somehow it adds size to the crop width or height.
I tried to research it but as far as I know the straightenAngle and CropAngle are supposed to be the same?
I tried settings.straightenAngle (instead of settings.CropAngle), but it didn't work at all.
Am I missing something here? Do I do something wrong?
Thank you all in advance!