Highlighted

How to remove photo from catalog programmatically

Dec 20, 2019

Copy link to clipboard

Copied

Hello,

I am able to add a photo by using catalog:addPhoto( path, stackWithPhoto, position )

 

I'd like to remove the photo once my operation is done. Or I'd like to completely remove the LrFolder from the Catalog. 

 

Is there any way to do this? I didn't find a way in the SDK. 

 

Any feedback would be greatly appreciated.

Thanks in advance!

Most Valuable Participant
Correct answer by johnrellis | Most Valuable Participant

Unfortunately, the SDK doesn't provide methods for removing photos or folders.  I've always guessed that this was deliberate -- Adobe wanted to protect users from poorly written plugins.

 

As a klutzy workaround, one of my plugins takes this approach: When it's finished with an imported photo, it deletes the underlying file from disk and moves the LrPhoto into a special collection called "OK To Delete".  Then the user can periodically delete that collection.

 

It's very unlikely at this point late in LR Classic's life that Adobe would ever add a delete method to LrPhoto.

 

[Use the reply button under the first post to ensure replies sort properly.]

Topics

SDK

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to remove photo from catalog programmatically

Dec 20, 2019

Copy link to clipboard

Copied

Hello,

I am able to add a photo by using catalog:addPhoto( path, stackWithPhoto, position )

 

I'd like to remove the photo once my operation is done. Or I'd like to completely remove the LrFolder from the Catalog. 

 

Is there any way to do this? I didn't find a way in the SDK. 

 

Any feedback would be greatly appreciated.

Thanks in advance!

Most Valuable Participant
Correct answer by johnrellis | Most Valuable Participant

Unfortunately, the SDK doesn't provide methods for removing photos or folders.  I've always guessed that this was deliberate -- Adobe wanted to protect users from poorly written plugins.

 

As a klutzy workaround, one of my plugins takes this approach: When it's finished with an imported photo, it deletes the underlying file from disk and moves the LrPhoto into a special collection called "OK To Delete".  Then the user can periodically delete that collection.

 

It's very unlikely at this point late in LR Classic's life that Adobe would ever add a delete method to LrPhoto.

 

[Use the reply button under the first post to ensure replies sort properly.]

Topics

SDK

Views

131

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Dec 21, 2019

Copy link to clipboard

Copied

Unfortunately, the SDK doesn't provide methods for removing photos or folders.  I've always guessed that this was deliberate -- Adobe wanted to protect users from poorly written plugins.

 

As a klutzy workaround, one of my plugins takes this approach: When it's finished with an imported photo, it deletes the underlying file from disk and moves the LrPhoto into a special collection called "OK To Delete".  Then the user can periodically delete that collection.

 

It's very unlikely at this point late in LR Classic's life that Adobe would ever add a delete method to LrPhoto.

 

[Use the reply button under the first post to ensure replies sort properly.]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
grcn LATEST
Dec 23, 2019

Copy link to clipboard

Copied

@johnrellis thank you so much for your answer. IMO, SDK, at least, should allow removing photos which have been added by catalog:addPhoto but before this, there are lots of things to fix 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...