Skip to main content
areohbee
Legend
June 17, 2013

P: SDK: catalog:createVirtualCopies only works properly in grid view.

  • June 17, 2013
  • 20 replies
  • 645 views

When more than one photo is selected, and more than one copy name is passed, I mean, in Windows anyway, maybe Mac too.

First off, I realize the SDK v5 has not been released, so if this bug report is premature, just ignore it.

That said, I wanted to report ASAP in the hopes that it will be fixed before SDK 5 is released, if applicable.

Problem is, plugin has no official way of assuring Lr is in grid mode. So createVirtualCopies needs to be fixed, or we need a way to force grid view, or both.

Again, my apologies in advance: I acknowledge this is an undocumented function.

Rob

This topic has been closed for replies.

20 replies

Legend
April 21, 2015
This should be fixed in Lightroom CC/Lightroom 6.
johnrellis
Legend
December 17, 2014
Great, thanks Paul.
Adobe Employee
December 9, 2014
I've reproduced this issue. A bug has been filed.
areohbee
areohbeeAuthor
Legend
April 30, 2014
Not fixed in Lr5.4.
areohbee
areohbeeAuthor
Legend
January 3, 2014
Thanks D.

I'm not sure why we're getting the silent treatment.

R.
Inspiring
January 1, 2014
I ran the script from Rob as listed above.

This problem is not solved in 5.3 version.

I tested it with 3 different computers:
1: Windows 7 Home Home Premium Edition
2: MacBook Air 11"
3: Laptop Windows 8.0

Conclusion:
1) On all three computers the test fails
2) On each computer the fail situation is different!!

Please solve this bug, because my plug-in relies on this great functionality!
Contact me if you need more info.

Computer 1: Windows 7
Loupe: Not Ok, failded
Grid: Ok.
Develop: Ok.

Lightroom version: 5.3 [938183]
Operating system: Windows 7 Home Premium Edition
Version: 6.1 [7601]
Application architecture: x64
System architecture: x64
Logical processor count: 8
Processor speed: 3,4 GHz
Built-in memory: 8173,1 MBWindows 7:

Computer 2: MacBook Air
Loupe: Not Ok, failed
Grid: Ok.
Develop: Not Ok, failed

Lightroom version: 5.3 [938183]
Operating system: Mac OS 10
Version: 10.9 [0]
Application architecture: x64
Logical processor count: 4
Processor speed: 1,7 GHz
Built-in memory: 4096,0 MB
Real memory available to Lightroom: 4096,0 MB

Computer 3: Laptop Windows 8
Loupe: Ok
Grid: Ok.
Develop: Not Ok, failed

Lightroom version: 5.3 [938183]
Operating system: Windows 8 Home Premium Edition
Version: 6.2 [9200]
Application architecture: x64
System architecture: x64
Logical processor count: 8
Processor speed: 2,3 GHz
Built-in memory: 6029,6 MB
Real memory available to Lightroom: 6029,6 MB
Real memory used by Lightroom: 629,8 MB (10,4%)
Virtual memory used by Lightroom: 606,4 MB
areohbee
areohbeeAuthor
Legend
September 17, 2013
Not fixed in Lr5.2 - what happened Paul?
areohbee
areohbeeAuthor
Legend
August 30, 2013
Thanks for checking D. I'm surprised it works for you in develop module - I just double-checked, 2 selected, got this:

Not sure why the results would not be the same for us, but regardless - there's definitely a bug... - thanks again, R.
Inspiring
August 30, 2013
Hi Rob, I ran your test and my results are:
Library Grid: 2 selected -> 2 Virtual copies created: test Ok
Library Loupe: 2 selected -> 1 Virtual copy created: test NOT Ok
Develop: 2 selected -> 2 Virtual copies created: test Ok

So yes, I support your point!

My system:
Windows 7-64 bits
Lightroom version: 5.0 [907681]
Operating system: Windows 7 Home Premium Edition
Version: 6.1 [7601]
Application architecture: x64
System architecture: x64
areohbee
areohbeeAuthor
Legend
August 18, 2013
Just double-checked that the test plugin is downloading OK. In any case, here is the guts of it:

local LrDialogs = import 'LrDialogs'

local LrTasks = import 'LrTasks'
local LrFunctionContext = import 'LrFunctionContext'
local LrApplication = import 'LrApplication'
local LrFileUtils = import 'LrFileUtils'

LrFunctionContext.postAsyncTaskWithContext( "CreateVirtualCopyTest", function( context )

LrDialogs.attachErrorDialogToFunctionContext( context )

local catalog = LrApplication.activeCatalog()
local targets = catalog:getTargetPhotos()
if #targets < 2 then
LrDialogs.message( "This test requires multiple photos." )
return
end
if #targets > 10 then
LrDialogs.message( "This test requires 10 or less target photos." )
return
end

for i, photo in ipairs( targets ) do
if photo:getRawMetadata( 'isVirtualCopy' ) then
LrDialogs.message( "Selected photos must not be virtual copies" )
return
end
end

local answer = LrDialogs.confirm( "Go? (" .. #targets .. " photos are selected)" )
if answer == 'ok' then
-- fine
else
LrDialogs.message( "canceled" )
return
end

local copies = catalog:createVirtualCopies( "CreateVirtualCopyTest" )
if #copies ~= #targets then
LrDialogs.message( "wrong number of copies created" )
return
end
for i, photo in ipairs( copies ) do
if not photo:getRawMetadata( 'isVirtualCopy' ) then
LrDialogs.message( "Test failed - '" .. photo:getRawMetadata( 'path' ) .. "' is not a virtual copy." )
return
end
end

LrDialogs.message( "Test passed - all copies are virtual.", "I bet you're in grid view(?) - now try it in loupe view or develop module - I bet it will fail (always fails on my setup anyway), or at least if you're testing it in Windows - may not fail on Mac: dunno." )

end )