Open dante987 opened 3 years ago
It does not follow the Windows Explorer "sort by" preference, nor should it. It has it's own sorting options. To find it, open an image in JPEGView ⇒ right click anywhere ⇒ look for "Display Order" ⇒ choose the sorting option you want.
I wish "Display Order" ⇒ "folder preference" was also an option there. Its more convenient that way.
Unfortunately, I don't even know if this is possible. While Windows Photo Viewer observes the "sort by" preference in a folder, I'm guessing it does it because it's tightly integrated with the Explorer process.
I don't know of any external apps which have this feature. If there is one, perhaps if it's open source, it'd be easier to figure out what APIs to call to read Windows Explorer's sort preference for a particular folder.
It would be nice to have... it was probably one of the first things I noticed when moving to JPEGView years ago.
"ImageGlass" is a software which has this feature.
hmmmmmmmmmmm let me look into that when I have time... perhaps perusing the ImageGlass source for stuff to put into JPEGView might be a good idea. Both are GPL licensed
@dante987 I looked into this... even ImageGlass' implementation has caveats... like you have to keep the Explorer window open, and some sorting doesn't work etc
I haven't looked into JPEGView's source code, but here is an information that might be useful.
Windows Explorer sorts files with StrCmpLogicalW(string, string)
function in shlwapi.dll
and it should be available from Windows XP.
From what I know, you can provide 'comparer' function as third argument in Sort()
function. This might be usable.
Here is C# code that I use in various places like PowerShell, C# etc.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace NaturalSort {
public static class NaturalSort {
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
public static extern int StrCmpLogicalW(string psz1, string psz2);
public static System.Collections.ArrayList Sort(System.Collections.ArrayList foo) {
foo.Sort(new NaturalStringComparer());
return foo;
}
}
public class NaturalStringComparer : IComparer {
public int Compare(object x, object y) {
return NaturalSort.StrCmpLogicalW(x.ToString(), y.ToString());
}
}
}
No matter what i select, be it Sort by: Name or Type or Size or Date modified etc., the next image using jpegview is always the same. How can i make it so that "next image" always follows windows explorer "sort by" preference. Please help.