Lightroom Classic: LrPhoto quick develop actions in latest SDK have incorrect documentation

  • 3
  • Problem
  • Updated 9 months ago
  • (Edited)
In the latest Lightroom Classic SDK documentation, the LrPhoto methods beginning with quickDevelop have documentation stating that the method is for the current photo. However, appying the method to any photo that is in a group of selected photos will apply the action to all selected photos.

I like that it is applied to all selected photos. That is what the user would typically expect. However the documentation, as stated above, is wrong.

To give an example, if two photos are selected and we apply photo:rotateRight to both photos, the photos end up rotated right twice for a 180 degree rotation. If we apply photo:rotateRight to one photo, both are rotated 90 degrees right.
Photo of Rory Jaffe

Rory Jaffe

  • 17 Posts
  • 2 Reply Likes

Posted 11 months ago

  • 3
Photo of Bhargav

Bhargav, Official Rep

  • 84 Posts
  • 20 Reply Likes
Hi Rory,

We just ran below sample to verify 

local catalog = import 'LrApplication'.activeCatalog()
local photos1 = catalog:getTargetPhoto()

We're not seeing the behaviour you mentioned.
Can you provide more details and sample script which you're using to reproduce the issue.

Photo of Rory Jaffe

Rory Jaffe

  • 17 Posts
  • 2 Reply Likes
Yes. Select two photos. Run your script again. You will see that both photos rotate right, not just the current photo.
Photo of John R. Ellis

John R. Ellis, Champion

  • 4846 Posts
  • 1340 Reply Likes
I observe the same behavior as Rory -- that script rotates all the selected photos.

Also, that script has a typo -- "photos1.rotateRight()" rather than "photos1:rotateRight()". Since "." was used rather than ":", that means that "rotateRight()" is not being invoked as a method call, and "photos1" is not being passed to "rotateRight()".  Thus, "photo:rotateRight()" must necessarily operate on the current selection, even if the selection doesn't include "photo".

That's a wierd definition for a method of LrPhoto. You'd expect that "photo:rotateRight()" would rotate "photo" only, just like any other method call on "photo". 

Thus, this is really a bug in the implementation of "photo:rotateRight()" rather than a documentation mistake.

It would be better to fix this bug and, if Adobe wants to provide the functionality of rotating all the selected photos, add LrSelection.rotateRight() and LrSelection.rotateLeft().