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


Permlink Replies: 19 - Pages: 2 [ 1 2 | Next ] - Last Post: 18 Jun 20, 20:09 Last Post By: MarkusD
MarkusD

Posts: 500
Registered: 13-Apr-2006
Keyword list only populates after visiting folders
Posted: 27 Aug 19, 18:12
 
  Click to reply to this thread Reply
Hi,

the list with keywords in the bottom panel only populates with keywords during visiting the folders where keywords are used. Please watch this Video.

I'm not sure if it's clear what I'm looking for. Imagine a project with a dozen of keywords used in a lot of different folders. Now you have added hundreds of new pictures and want to use the already used keywords for drag&drop to tag the new pictures. But to see all of the already used keywords you have to navigate to a lot of folders first. If you close JA, you have to start all over. :-(

Wouldn't it possible to have a keyword-list which is stored in the JAP-file or in the top most ".info" file of the project. And then by opening a project the bottom panel with the keywords shows all keywords immediately.

Thanks, Markus
JeffTucker

Posts: 7,375
Registered: 31-Jan-2006
Re: Keyword list only populates after visiting folders
Posted: 27 Aug 19, 22:01   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Shorter version: When opening a project and displaying keywords, it should do a quick traversal of the project tree and harvest all of the keywords for display in the bottom panel.

In a massive project, that's an awful lot of file IO - might be painfully slow. Keeping them all in a central .info file in addition to the .info file for each image, however, runs the risk of things getting out of sync.

Tough call.

Or, a user could take the "self-help" way. Add an image to the top level of the album. Visit each folder, so that the keyword list is populated with all of the possible keywords from the album. Select all of them (click on the first, shift-click on the last), then drag them all to that one new image. Now exclude that image.

That image won't appear in the album. But when you open the project, you'll see all of your keywords immediately. It's devious. I like it. ;)
MarkusD

Posts: 500
Registered: 13-Apr-2006
Re: Keyword list only populates after visiting folders
Posted: 27 Aug 19, 22:16   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
jGromit wrote:
Shorter version: When opening a project and displaying keywords, it should do a quick traversal of the project tree and harvest all of the keywords for display in the bottom panel.
I would never have dared to ask. ;-)

In a massive project, that's an awful lot of file IO - might be painfully slow.
Good point.

Keeping them all in a central .info file in addition to the .info file for each image, however, runs the risk of things getting out of sync.
I agree.

Or, a user could take the "self-help" way. Add an image to the top level of the album. Visit each folder, so that the keyword list is populated with all of the possible keywords from the album. Select all of them (click on the first, shift-click on the last), then drag them all to that one new image. Now exclude that image.
Phew! ;-)

That image won't appear in the album. But when you open the project, you'll see all of your keywords immediately. It's devious. I like it. ;)
;-))

Or. Giving the user the opportunity to traverse through the whole project with a special button. If this task only starts when the user is ready to wait, that would be a good compromise.
RobM

Posts: 3,483
Registered: 4-Aug-2006
Re: Keyword list only populates after visiting folders
Posted: 27 Aug 19, 22:25   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
There is an API call that might prove useful, somehow - http://jalbum.net/api/se/datadosen/component/WordList.html
davidekholm

Posts: 3,681
Registered: 18-Oct-2002
Re: Keyword list only populates after visiting folders
Posted: 28 Aug 19, 12:37   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I plan to address this in a way that doesn't cause an awful amount of IO, due to disk caching, but it will be a larger rewrite: The idea is to background generate .json files (which contains metadata, like keywords) under the .jalbum folders while a project is open in jAlbum. This will enable both faster album makes (the json files are simply copied from the .jalbum folders to the generated album folder) and will enable album search within jAlbum itself and naturally enable quick population of the keyword list as a project is opened.
JeffTucker

Posts: 7,375
Registered: 31-Jan-2006
Re: Keyword list only populates after visiting folders
Posted: 28 Aug 19, 13:33   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
So, we'll end up with .info files and .json files, and maybe some .properties and .txt files, plus some metadata written to xmp within the image files? Yes, no chance for confusion there.
davidekholm

Posts: 3,681
Registered: 18-Oct-2002
Re: Keyword list only populates after visiting folders
Posted: 28 Aug 19, 14:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
jGromit wrote:
So, we'll end up with .info files and .json files, and maybe some .properties and .txt files, plus some metadata written to xmp within the image files? Yes, no chance for confusion there.

Sure, but it shouldn't bother end users as all is stuffed under .jalbum. The code to generate the json data will be the same as today, but I'll have it running in the background while a project is open and direct the output to he source image tree instead of to the album folder.
RobM

Posts: 3,483
Registered: 4-Aug-2006
Re: Keyword list only populates after visiting folders
Posted: 28 Aug 19, 15:04   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
jGromit wrote:
So, we'll end up with .info files and .json files, and maybe some .properties and .txt files, plus some metadata written to xmp within the image files? Yes, no chance for confusion there.

Sure, but it shouldn't bother end users as all is stuffed under .jalbum. The code to generate the json data will be the same as today, but I'll have it running in the background while a project is open and direct the output to he source image tree instead of to the album folder.

And of course, there are skin and tool developers that put files in .jalbum folders too.
MarkusD

Posts: 500
Registered: 13-Apr-2006
Re: Keyword list only populates after visiting folders
Posted: 9 Jun 20, 20:16   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
jGromit wrote:
So, we'll end up with .info files and .json files, and maybe some .properties and .txt files, plus some metadata written to xmp within the image files? Yes, no chance for confusion there.

Sure, but it shouldn't bother end users as all is stuffed under .jalbum. The code to generate the json data will be the same as today, but I'll have it running in the background while a project is open and direct the output to he source image tree instead of to the album folder.

David, is there a chance that this issue will be solved in an upcoming version? Thanks, Markus
davidekholm

Posts: 3,681
Registered: 18-Oct-2002
Re: Keyword list only populates after visiting folders
Posted: 12 Jun 20, 13:33   in response to: MarkusD in response to: MarkusD
Helpful
  Click to reply to this thread Reply
MarkusD wrote:

David, is there a chance that this issue will be solved in an upcoming version? Thanks, Markus

I have concerns about firing off a long running background task that iterates over all images of huge album projects gathering keywords, but I've put together this external tool that does this job. If it takes too long, it opens a small dialog that allows you to cancel a too long running task. Just put it inside jAlbum's Tools directory. Use the tools directory of jAlbum's config directory so it survives restarts (create it if it's missing)

Here's the code for this tool. Be inspired about the structure of it. It's short and runs in the background and allows user interruption:
import net.jalbum.util.*;
 
MonitoredWorkQueue queue = new MonitoredWorkQueue(window, "Looking up keywords");
queue.submit () -> {
  WordList knownKeywords = window.albumExplorer.knownKeywords;
  rootFolder.descendants.forEach (ao) -> {
    if (ao.isFolder()) queue.message = ao.parent.name;
    knownKeywords.addAll(StringUtil.stringToSet(ao.keywords));
    // Thread.sleep(100); // Uncomment to trigger progress monitor to open
    if (queue.isAborted()) return;
  }
}
queue.awaitCompletion();
MarkusD

Posts: 500
Registered: 13-Apr-2006
Re: Keyword list only populates after visiting folders
Posted: 12 Jun 20, 18:20   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
MarkusD wrote:

David, is there a chance that this issue will be solved in an upcoming version? Thanks, Markus

I have concerns about firing off a long running background task that iterates over all images of huge album projects gathering keywords, ...

I totally understand that.

but I've put together this external tool that does this job. If it takes too long, it opens a small dialog that allows you to cancel a too long running task. Just put it inside jAlbum's Tools directory. Use the tools directory of jAlbum's config directory so it survives restarts (create it if it's missing)
Just used that tool. It took some minutes to crawl to my album with some 12k objects. ;-)

So what can a user do:
  • Use the tool to collect all keywords;
  • Use one object (in the root folder) in your album which is excluded and connect all of collected keywords to that object. Repeating what jGromit wrote earlier: „Or, a user could take the "self-help" way. Add an image to the top level of the album. Visit each folder, so that the keyword list is populated with all of the possible keywords from the album. Select all of them (click on the first, shift-click on the last), then drag them all to that one new image. Now exclude that image.“

And you are done. :-)

So, that request is solved. Thanks a lot!
davidekholm

Posts: 3,681
Registered: 18-Oct-2002
Re: Keyword list only populates after visiting folders
Posted: 16 Jun 20, 20:37   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Good that it's good enough :-). Minutes? That calls for some optimization. Try this one instead. it uses multiple parallel threads to gather the keywords.
The code change for this was minimal due to Java's nifty streams API. I just added .parallelStream():
import net.jalbum.util.*;
 
MonitoredWorkQueue queue = new MonitoredWorkQueue(window, "Looking up keywords");
queue.submit () -> {
  WordList knownKeywords = window.albumExplorer.knownKeywords;
  rootFolder.descendants.parallelStream().forEach (ao) -> {
    if (ao.isFolder()) queue.message = ao.parent.name;
    knownKeywords.addAll(StringUtil.stringToSet(ao.keywords));
    // Thread.sleep(100);
    if (queue.isAborted()) return;
  }
}
queue.awaitCompletion();
MarkusD

Posts: 500
Registered: 13-Apr-2006
Re: Keyword list only populates after visiting folders
Posted: 16 Jun 20, 22:34   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Good that it's good enough :-). Minutes? That calls for some optimization. Try this one instead. it uses multiple parallel threads to gather the keywords.

Yes, it started very fast, but after some seconds I got an error:
java.lang.NullPointerException in Look up keywords.groovy
davidekholm

Posts: 3,681
Registered: 18-Oct-2002
Re: Keyword list only populates after visiting folders
Posted: 16 Jun 20, 23:23   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
davidekholm wrote:
Good that it's good enough :-). Minutes? That calls for some optimization. Try this one instead. it uses multiple parallel threads to gather the keywords.

Yes, it started very fast, but after some seconds I got an error:
java.lang.NullPointerException in Look up keywords.groovy


Probably need to synchronize on a line or two of code. Did you get a full stack trace printed to the system console perhaps?
MarkusD

Posts: 500
Registered: 13-Apr-2006
Re: Keyword list only populates after visiting folders
Posted: 16 Jun 20, 23:27   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
MarkusD wrote:
davidekholm wrote:
Good that it's good enough :-). Minutes? That calls for some optimization. Try this one instead. it uses multiple parallel threads to gather the keywords.

Yes, it started very fast, but after some seconds I got an error:
java.lang.NullPointerException in Look up keywords.groovy

Probably need to synchronize on a line or two of code. Did you get a full stack trace printed to the system console perhaps?

"Bad news": I started the tool again, no error now. BTW: Run time: just a few seconds. ;-)
Legend
Forum admins
Helpful Answer
Correct Answer

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