Editing metadata in collection view is "slow"

Started by KimAbel, December 25, 2014, 04:38:20 PM

Previous topic - Next topic

KimAbel

I have some "trouble" with editing metadata in the collection view. This is also related to a feature request I have, but I am wondering if any one else has a work around since it has'nt been implemented.

https://www.photools.com/community/index.php?topic=2312.msg14804#msg14804

In the collection view I am using one of the collections to edit metadata. This could for instance bee images labeled blue, or bookmarked images. I edit Description, Location fields, keywords and copyright fields. My trouble is that when I have edited one field and for instance are shifting to Description and starts typing, then IM5 starts recalculating the collection tree and I am thrown out of the Description field. In order to stay into the Description field I have to wait for quite a long time (this can be over 30 sec) to wait for IM5 to finish recalculating. This makes it very hard to get an efficient workflow when I am editing metadata. The time example is from working on 47 bookmarkeds images and it is annoying to have to wait so long each time I want to edit a new field (my database is on a SSD disc).

So is there another way of doing this so that I dont have to wait so long between each edit? (I dont use immediate writeback)
I know that I can edit images from the folder view, but collections (and categories) are one of the key benefits of IM5, so beeing able to use these for editing is very useful.

Kim Abel

ubacher

Work around: Move all your images into a result view. This in effect "freezes" all you files so they stay
on the screen. Not sure if there is an easy way to do this - I have a little script which does this for me.
I'll attach it - if you like to try it.

[attachment deleted by admin]

Ferdinand

That script is a neat idea.

In the menu bar under views, there is a sub-menu for result windows, but it doesn't have many entries.  I wonder if it might be possible to have entries like "new result window from current file window" or "new result window from currently selected files", or whether Mario would think that a script like yours is the better way to do this.

Mario

Modifying metadata, reading and writing files etc. can cause many collections and categories to become invalidated or updated. Such events are then posted on the IMatch software bus, because many parts of IMatch (Views, panels, the file and result windows etc.) need to react on such events. How to react on an event like "collection X was updated" depends on the module which processes the event.

IMatch tries to be smart and to process only the events relevant for the current window or panel, and then ads some extra smarts on top of that to further limit the actions caused by the event.

For example, the file window reacts on collection events differently whether or not a collection is currently displayed. If the file window is displaying folders, categories or timeline nodes, it notes collection updated events and only remembers to reload the icon state for each file when it is next needed (immediately for the visible files, delayed for the files not visible until you scroll them into view).

A collection update also may affect one or more of the loaded filters. Or the rating & label control in the Metadata Panel. If this is the case is not always easy to determine, for example when the user has a category filter enabled and one of the categories is based on a @Collection formula. Or on a rating or label. There are tons of such special cases which need to be handled - and sometimes it's harder and more computing intensive to find out if a collection update requires an update of the filter / metadata / nnn panel than to just update the panel. It's technically challenging, especially since collection updates often cascade, e.g. adding a red dot to a file also requires an update of the "no dot" collection etc.

The the specific case described here (file window displays a collection and while the user is typing in the metadata panel, the metadata panel reacts on a collection changed message, aborting/closing the current edit cycle) I was able to implement an improvement. I still need to test it to make sure that it has no side effects, though.

The improvement has to do how the file window determines which collection has changed, if one or more of the selected files are affected by this change and if this then requires an update of the metadata panel. For most collection changes, if none of the selected/focused files is in that collection, the metadata panel update can be skipped. Of course if you change the collection you are looking at in the file window, there will be updates. And panels like the HTML panel or the filter panel are still always updated because it is almost impossible to reliably determine if an update to one or more collections affects the panel.

If you have dozed off by now: that's just the tip of the iceberg, technically speaking. Managing all the stuff going on behind the curtain when you do as little as changing a rating or some metadata is really complicated.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

I didn't doze off, although IIRC (if I recall correctly), you've explained at least some of this before.

But you didn't answer the question about whether the ability to generate a new result window from the selected files in the file window would be a good idea or not.  This would enable metadata / collections to be edited without triggering any of this stuff.  Ubacher's script (which I haven't tried yet) reportedly will do this, but is there scope for native capability along the lines I suggested?

Mario

QuoteBut you didn't answer the question about whether the ability to generate a new result window from the selected files in the file window would be a good idea or not.  This would enable metadata / collections to be edited without triggering any of this stuff.
We have something like that for versions. I really did not consider this comment. I think the OP will find that it works much better in 5.3.2 so this may be irrelevant by then. It is easy to write a script which does open a result window from a selection of files, so if this is needed, somebody may write and post a script. Else, a feature request is the best way.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

KimAbel

Thanks ubacher for the script. Much appreciated. I will try the script soon.

And thanks Mario for trying to solve the slow editing. I will try your next release to see if it is better. Hopefully this will work  :)

I see that this is a complex task, but in my opinion this is something almost anyone working with IM5 will encounter many times. Editing metadata is one of the main features of IM5 and to be able to do this effectively even in categories or collections would be of interest to many users. Im5 is a wonderful tool, so powerful and rich in features, but for me the most important thing is to be able to work effectively with my metadata. Thats why I initially was hoping for a pause function so that one could work with metadata with a selection of files without experiencing that you get thrown out of metadata fields, or that the focused image shifts each time IM recalulates the category or collection.

As it is now I have two "places" in IM5 that steals much of my time editing metadata. The first one is what this post has described and the other is cases with conflicting metadata. Trying to remove conflicting metadata steals so much time from me that it is really getting painful  :'( (not your fault  :) ), but I will adress this in a new post at a later time when I get som more time. I have a feature request about this, but I have some elaboration on this.

https://www.photools.com/community/index.php?topic=2659.msg17249#msg17249

Kim Abel

Ferdinand

May I make a small suggestion about this script?  You need to

Set imgs = Nothing

before the script exits, or you will create a memory leak.  You probably need this twice, including the no images exit.

Mario

Not deleting objects created with new or other operations will not only cause memory leaks but may also prevent IMatch from closing properly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I understood that only when I use NEW I will have to reset to nothing at the end.
Is that wrong?

I did check my scripts previously for that - Of course it is possible that I missed some.

Mario

Always keep an eye out for set bla = , which usually requires a set bla = nothing afterwards.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

Quote from: ubacher on December 29, 2014, 02:18:24 PM
I understood that only when I use NEW I will have to reset to nothing at the end.
Is that wrong?

I think it's any SET command, not just SET NEW.  At least that's my understanding, but I am mainly relying on what I've been told by more knowledgeable people (e.g. Mario) when I say this.

Mario

The Basic language help available in the scripting editor should have to say something on this in more detail. I just match each set x = bla with a set x = nothing all the time.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

QuoteThe Basic language help available in the scripting editor should have to say something on this in more detail.

I looked under SET and under NOTHING: did not enlighten me.

QuoteI just match each set x = bla with a set x = nothing all the time.
Not in your sample scripts you do.

KimAbel

QuoteThe the specific case described here (file window displays a collection and while the user is typing in the metadata panel, the metadata panel reacts on a collection changed message, aborting/closing the current edit cycle) I was able to implement an improvement. I still need to test it to make sure that it has no side effects, though.

I cant see much improvement in 5.3.2, but perhaps you havent implemented it yet? Still jumps a lot out of the edit session.

Kim Abel