Images shown twice in result window

Started by hluxem, July 02, 2023, 02:05:51 AM

Previous topic - Next topic

hluxem

This is not a big deal for me and I can't duplicate it yet.
When working with a selection in a result window and switching back and forth between category and folder view either one or more images how 2 thumbnails. The viewer does only show one instance no matter how many duplicates the thumbnail window shows. If I change the rating or copy metadata for one files it shows in both thumbnails.

Heiner

Mario

With which command or process do you create the contents of the Result Window?
A Result Window may contains the same file multiple times, depending on the command used to create it and the options chosen by the user. More details, please.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

hluxem

I use a Streamdeck device to open the result window. That uses the Ctrl+G,R shortcut. These multiple files are not there when the result window is created. 
I think you can't add or remove files from a result window after you opened it, at least I can't find anything in the help about it.
Unfortunately, I don't have more information at this point but will watch more closely. 


QuoteA Result Window may contains the same file multiple times, depending on the command used to create it and the options chosen by the user. 
What command would allow to get the same file shown twice in a result window? Not sure if could manage in any window to have the same 2 files shown with 2 thumbnails.

Mario

Similar images. A file can be similar to more than one original file.

So you open Result Windows from an arbitrarily selection in a File Window.
Then you switch between the Result Window, the Media & Folders View and Category View and suddenly the Result Window shows the same file multiple times.
Do you perform any operations or commands or do you just switch between the different View?
I've tried the switching a couple of dozen times, but so far no files were duplicated in the Result Window.

Is the Result window created from a selection of the folder or category you switch between?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

hluxem


QuoteSimilar images. 
No, these are the exact same files. That's what confused me when it happened the first time. The viewer only shows one instance. I took a screenshot, but that doesn't give any more information either.
Quotesuddenly the Result Window shows the same file multiple times.
So far it was one or more files with 2 thumbnails.
QuoteDo you perform any operations or commands, or do you just switch between the different View?
Mostly using the viewer and changing ratings
QuoteIs the Result window created from a selection of the folder or category you switch between?
A filtered view from a folder with subfolders



Mario

QuoteA filtered view from a folder with subfolders
This is what I mean when I ask for more details.
Just consider what I need to know to do the same you do. Which includes that I need to know how you open the result window, which files you put into it etc.
Creating a selection of a File Window showing a folder with sub-folders and one or more active filters.

Every detail matters.
I could so far not reproduce this, no other user reported a similar problem etc.
If I can reproduce it, I can fix it.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

hluxem

QuoteIf I can reproduce it, I can fix it.
I know :>) The problem is when you working with the program you don't realize this right away and certainly don't know how you got there. First I thought they are real duplicates. The second time I thought, that's strange and tried to make sure it's not me doing something wrong. 

Luckily, it just happened again and I was able to reproduce it. That may help you unless it's a computer specific thing.

Here is what I did:
  • Created a result window from a filtered folder selection with 7 files using Ctrl+G,R 
  • Selected one file, used the goto folder short cut
  • unpaused filtering for that folder
  • deleted that file
  • went back to the selection and the last file in the selection showed twice

I then duplicated another folder, created a selection with 12 files and started deleting a file at a time in the folder view. Every time another thumbnail shows up twice, first the last on, then the second to last one and so on.
It doesn't matter if you use the goto folder short cut or the folder tab to switch views. 
Deleting a file in the selection does not do this.

Hope that helps,

Heiner


Mario

Found it. Fixed it.

File Windows must monitor all events that happen on the IMatch event bus.
If the rating of a file is changed, metadata is modified, a file is renamed, moved or deleted, all this may be of interest for a File Window. For example if a file is removed, the File Window must check if it contains the file, and then remove it.

There are many File Windows in IMatch, depending on how many Views the user had open in the current session (File Windows are created when the View becomes active for the first time).
A File Window may be active (the "current" File Window visible to the user. Or it might be inactive, when it is the File Window for a View not visible. It may also be paused.

IMatch optimizes event processing. Depending on whether or not a File Window is active or not (or paused), it postpones actions until the File Window becomes active or un-paused again. For example, if metadata in files is changed or files are deleted, but the File Window is not active, it just remembers to reload completely when it becomes active the next time.
This saves a lot of time and resources.

Result Windows are built based on a query result. This can be a search for duplicate or visually similar files, a "show all files with the same value" query, app queries or, as in your case, from an arbitrary selection of files.

You select 10 files and open a Result Window from them.
You switch to another File Window and delete one of the files.

The inactive Result Window receives the event about the deleted file and removes it.
It also remembers to reload when it becomes active so that all variables, layout attributes and whatnot the user has used are refreshed and values.

Now you switch back to the Result Window. It becomes active and reloads itself.
Being a Result Window created from a query result, it loads the query result again. This works fine. A query can always be re-run - with one exception: A query produced from a manual selection the user has made.

And this was the bug.
IMatch did not update the query result to remove the no longer existing file (could be an original or a match).
And when reloading the original selection of files, a no longer existing file was used. Which confused the sorter algorithm that is responsible for all the sorting features in File Windows. And the end result was that one file was duplicated to fill the vacated spot left by the deleted file.

Phew :'(

This was an old bug. Nothing too harmful, but a bug nevertheless.
Since I could reproduce it, I could fix it in less than an hour.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

hluxem

Great, I almost expected to see that message after I could reproduce it:>)!

Great support as always!

Heiner