I need an Plugin for visually comparing / viewing directories of images

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *lbug »

Thank you for all these suggestions!

To start with the commercial tools:
Yes, I saw the screenshot of Beyond Compare showing the two thumbnails side-by-side, together with lots and lots of more functionality. But I do not like trial-versions which fill up the Windows registry with trash, so I will not do a test-installation. The same goes for Araxis Merge.
If I would need the whole functionality professionally, I would buy the product. But right now, all my uses cases are of private nature - so I would rather invest time to write some own quick-and-dirty viewer than paying for and installing a commercial software I would only use up to maybe 1 % of its functionality.
Thus, the scripted suggestions are of much more interest to me.

Hacker wrote: 2023-08-19, 08:46 UTC [...]
To answer your question, no, this is currently not possible in any direct way.
[...]
Thanks for the clarification.

petermad wrote: 2023-08-19, 12:17 UTC [...]
This solution does that by using the separate QuickView window and automatically finding the file with the same name in the opposite panel.
[...]
Thanks for your proposal. I did not even know about the QuickView within TC before. I always use the long view to see all details. Your suggestion seems to only cover the comparison of a single image pair. Is that right?
But I am searching for an efficient way to browse two directories full of thousands of pairs, with arbitrary content (no "small differences" but rather my rabbit-and-carrot-example from above).

Hacker wrote: 2023-08-20, 20:23 UTC lbug,
Here is an AutoHotkey script which hopefully does exactly what you want.
[...]
That sounds most interesting! I have not been working with AutoHotKey before but I will definitely try out your script! First, I will have to look through it, because I want to understand the dependencies (and I never just execute downloaded scripts).
I am most curious how efficient the directory browsing will be. (I have less experience with XnView but I think it does load directory contents faster than IrfanView. I will test that.)
User avatar
Hacker
Moderator
Moderator
Posts: 13068
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *Hacker »

lbug,
I have less experience with XnView
Oh, you can use any image viewer you like, as long as it accepts a file name of an image as a command line parameter.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
petermad
Power Member
Power Member
Posts: 14810
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *petermad »

Your suggestion seems to only cover the comparison of a single image pair. Is that right?
Yes it toggles between showing the a file with the same name in the left panel and the right panel. problem is that for each toggle TC has to load the image again, so there can be some delay for big files.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *lbug »

Hacker wrote: 2023-08-22, 12:28 UTC [...]
Oh, you can use any image viewer you like, as long as it accepts a file name of an image as a command line parameter.
[...]
Now, I had some time to test the AHK-script. I did so with XnView and IrfanView and there are some findings I want to share.

1. Sadly, the script does not work with portable apps (https://portableapps.com/apps/graphics_pictures/xnview_portable). I guess this is caused by the usage of the PID of the started processes (This will only be the XnViewPortable.exe, not the xnview.exe.) and the inability of the PortableApps-launcher the launch multiple instances.
2. Using the xnview.exe directly, the script is working in a plain functional way.
3. Sadly, the short cut ([Page down]) will often stop working (e.g. sometimes when the viewer windows lost the focus, because I switch to some other window). In this case I can still use [Page up] but no [Page down] anymore.
4. But the most staggering result is that this solution is sooo slow!

Sorry, but I cannot use this script to browse through my directories of thousands of image pairs. (I did not even load those directories but only much smaller test directories.)
I can hold down [Page Down] to "scroll" with maximum speed (maximum keyboard repetition rate set in Windows) which should result in many repetitions per second. But closing the old XnView-Instances and loading and placing new ones needs up to 3 s on my PC, without having even a split second to view the two images side-by-side! IrfanView is slightly faster, but no magnitude.
This seems to be an insurmountable obstacle. No matter if all the pictures do reside on an SSD or all my few test image files as well as the image viewer itself have been preloaded before, it does take this time to switch to the next image pair!
That means, "scrolling" through 10000 pairs would take 8 h 20 min, without any time to really look at them, because the viewer instances are, of course, closed and opened one by one. - I think, I am even faster, switching manually with [Space], [Alt]+[Tab], [Space] between two IrfanView-instances.

So, let me again thank all of you for your explanations, suggestions and proposals for solutions.
But I guess, I will have to invest the time to build something own to really scroll / browse through these image directories.


PS:
I just had an idea:
Is it possible to open both image viewers only once? Giving both a temporary built filelist-file as a start-up-parameter? I had read about such an option for IrfanView. I do not know about the capabilities of AHK. Can it create temporary text files? Can it transform its captured hot keys into keyboard input for more than one window (like [Space] / [Backspace] which are the default keys for advancing in both directions within IrfanView)?
With just holding a key, I can browse through multiple images per second using only one instance of the viewer. There should be a way to do the same with two instances simultaneously.
User avatar
Hacker
Moderator
Moderator
Posts: 13068
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *Hacker »

lbug,
XnViewPortable.exe
Can't XnView be made portable using its original installation? Does one need to use the PortableApps version?
Sadly, the short cut ([Page down]) will often stop working
Hmm, there is no reason it should stop working, unless something else steals the hotkey. You can try adding

Code: Select all

#UseHook
as the first line of the script, this should make keyboard shortcuts more reliable.
I can hold down [Page Down] to "scroll" with maximum speed
Yeah, that was not really the design goal. I thought you wanted to compare the pairs one by one, decide which one is "the correct one", and move to the next pair, e.g. spending at least a second per pair. In that case the speed would not be a problem. Speeding through all images is not really fast in any viewer from my experience (with FastStone being the least bad IIRC), let alone closing it and reopening with a new image, and that two times for each image. So yes, it was not built for speed.

What I could perhaps do, is monitor the currently opened image in Xnview 1, and if the image stays open for say, one second or more, I could open Xnview 2 with the corresponding image from the other folder next to it. Would that be of any use to you?
I think, I am even faster, switching manually with [Space], [Alt]+[Tab], [Space] between two IrfanView-instances
That is most probably the case, but you lose the pairing of the duplicate names, instead just switch to the next image. Of course, a script can simulate sending Space to both viewer windows, if that helps.
Is it possible to open both image viewers only once? Giving both a temporary built filelist-file as a start-up-parameter?
That is actually a great idea.

[An hour later...]

Well, no luck with XnView, initially it shows only the files from the duplicates list, however, it browses through all files, not only those specified in the file list. If you find a viewer that can do that, I can adjust the script (or you can if you know how). Otherwise the only solution that currently comes to mind is creating two dirs with hardlinks to the duplicate files in the original dirs. Which would be a problem for different drives / network drives, etc.

Here is the adjusted script:

Code: Select all

#UseHook
#SingleInstance, Force

Dir1 := SubStr(A_Args[1], 1, -1)
Dir2 := SubStr(A_Args[2], 1, -1)
FileMask := A_Args[3]
Viewer := A_Args[4]

Loop, Files, % Dir1 . "\" . FileMask
	FileList .= A_LoopFileName . "`n"
Loop, Files, % Dir2 . "\" . FileMask
	FileList .= A_LoopFileName . "`n"

Sort, FileList, CL

PreviousFileName := ""
FilesInBothDirsList := ""
Loop, Parse, FileList, `n, `r
{
	If (A_LoopField = PreviousFileName)
	{
		FilesInBothDirsList1 .= Dir1 . "\" . A_LoopField . "`n"
		FilesInBothDirsList2 .= Dir2 . "\" . A_LoopField . "`n"
	}
	PreviousFileName := A_LoopField
}

FileList1FileName := % A_ScriptDir . "\TempImageList1_" . A_Now
FileList2FileName := % A_ScriptDir . "\TempImageList2_" . A_Now

FileAppend, % FilesInBothDirsList1, % FileList1FileName
FileAppend, % FilesInBothDirsList2, % FileList2FileName

Run, % """" . Viewer . """ -filelist """ . FileList1FileName . """", % Dir1, , Viewer1PID
Run, % """" . Viewer . """ -filelist """ . FileList2FileName . """", % Dir2, , Viewer2PID

Sleep, 10000

FileDelete, % FileList1FileName
FileDelete, % FileList2FileName

PgDn::
	WinActivate, % "ahk_pid " . Viewer1PID
	Send, {PgDn}
	WinActivate, % "ahk_pid " . Viewer2PID
	Send, {PgDn}
Return

PgUp::
	WinActivate, % "ahk_pid " . Viewer1PID
	Send, {PgUp}
	WinActivate, % "ahk_pid " . Viewer2PID
	Send, {PgUp}
Return
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6498
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *Horst.Epp »

2Hacker
IrfanView accepts the parameter /filelist=txtfile
and works correct only in this list.
I use it from TC with the parameter /filelist=%UL
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.3 x64
Post Reply