This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Pages: 1 - Last Post: 20 May 25, 17:27 Last Post By: davidekholm Threads: [ Previous | Next ]
EricLEdberg

Posts: 10
Registered: 6-Jan-2015
Linked Folder: Is there a way to auto-remove a previously-linked image?
Posted: 10 May 25, 23:45
 
  Click to reply to this thread Reply
I am trying to use jAlbum more to see if I can manage my photo collections using it's tools in the hopes of being less dependent on Adobe Photoshop Elements. For the last 15 years, I've use PSE to manage my photo collection. I often delete "crappy" photos several weeks after finalizing a collection or when moving them to their final managed folder location.

In my test, I've created a linked jAlbum folder to process my incoming photo folder tree (PSE managed)

jAlbum nicely recognizes new images as they are added, but maintains links to photos that were deleted by PSE or other means later on. I must manually delete the missing photos from the jAlbum linked-folder project when they are deleted by other means.

Q: Is there a way that jAlbum can automatically unlink a photo when it no longer exists in
*it's linked folder (or a button/tool to do this)? Today, it presents a missing file icon

It would be nice if an option was added in the linked folder project to blindly mirror the contents of the source folder and auto-unlink missing photos,
davidekholm

Posts: 3,719
Registered: 18-Oct-2002
Re: Linked Folder: Is there a way to auto-remove a previously-linked image?
Posted: 11 May 25, 13:34   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
I'll see if we can improve this type of linking so it dynamically detects new files and deletes broken links. In the meantime, here's a script that deletes broken links for a project. You can either execute it from jAlbum's system console window (F7) or place it in a file called "Delete broken links.groovy" that you place in a "tools" folder within jAlbum's "config" folder (See Tools-Open directories-Config directory):

Work work = Work.on(rootFolder.descendants)
.titled("Delete broken links")
.inform("This script deletes broken links from this project")
.filter(ao) -> { ao.Category != Category.webPage && ao.link && !ao.file.exists() }
.forEach(ao) -> {
	println(ao);
	ao.delete();
}
.execute(work) -> {
	// Refresh display
	explorer.context.viewFolder(explorer.context.currentFolder);	
	window.statusBar.setText("Processed ${work.processed} objects");
}
.showResult();
EricLEdberg

Posts: 10
Registered: 6-Jan-2015
Re: Linked Folder: Is there a way to auto-remove a previously-linked image?
Posted: 20 May 25, 13:33   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I marked the question as answered as the script example correctly deletes references to linked images that no longer exist in the opened project.

There was 1 issue on initial installation:

When I placed the script in the Tools -> Open Directories -> Config Directory, it opened the following folder. After restarting I could not see the script in the Tools -> External Tools.

C:\Users\ele\AppData\Roaming\JAlbum

I placed the script in the folder below and after a restart it appeared and, when executed, removed the broken links as expected.

C:\Program Files\jAlbum\tools

Thanks again.

Edited by: EricLEdberg on 20 May 2025, 13:33
JeffTucker

Posts: 8,104
Registered: 31-Jan-2006
Re: Linked Folder: Is there a way to auto-remove a previously-linked image?
Posted: 20 May 25, 14:53   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
David's post states, correctly, that the tool should be placed in a "tools" folder under your config directory.
davidekholm

Posts: 3,719
Registered: 18-Oct-2002
Re: Linked Folder: Is there a way to auto-remove a previously-linked image?
Posted: 20 May 25, 17:27   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
Place it under C:\Users\ele\AppData\Roaming\JAlbum\tools. Create the "tools" folder if needed.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums