Files and folders are not correctly sorted

Reported bugs that have been closed and/or resolved

Moderators: XnTriq, helmut, xnview, Dreamer

Post Reply
MarlonB
Posts: 29
Joined: Sun Jul 12, 2020 9:35 pm

Files and folders are not correctly sorted

Post by MarlonB »

Hi,

I have several folders with 50k+ images, and when I sort them in XnView, the sorting isn't always correct. For example, I'm looking at a long list right now which has a sort order of:
  • 0007*
  • 007**
  • 07***
  • 7****
  • 000**
So until the filenames begin with a "7", all is sorted correctly, afterwards, files starting with "0" start appearing again. This happens within the same folder on numerous occasions

The folders themselves are sorted incorrectly as well, for example:
  • pea
  • peaf
  • peaf-k
  • pea-k
I'd assume these folders to be sorted as
  • pea
  • pea-k
  • peaf
  • peaf-k
as the dash comes before the letters ASCII wise.

I've tried changing the setting Browser / File list / Folder always sorted alphabetically, but this doesn't change anything.

edit: forgot to mention, I'm using
XnView MP Windows
Version 0.98.2 64bits (Feb 19 2021)

Any idea how to get these sorted correctly?

Thanks!

Marlon
User avatar
masterjp
Posts: 424
Joined: Fri Feb 13, 2009 4:37 pm
Location: Duesseldorf, Germany

Re: Files and folders are not correctly sorted

Post by masterjp »

I created your folder names within a directory and the sorting is correct!

0000
007
07

pea
pea-f
pea-k

Maybe your sorting filter is set to another entry?

Maybe you use a "o" and not a "0" (=zero)?

Try to rename the folder with "0000" to "test" and rename it back to "00000".



Sort by name should work perfect.

Here you can see the result:
XnViewMP.png
PC: Intel 8700k + Asus Z370-F + 16 GB RAM G.Skill + Asus RTX 3050 OC + Samsung SSD
OS: Windows 10 Pro 64bit 22H2 |
GFX: XN-View 2.51.5 | XnViewMP 1.6.5 | XnConvert 1.100.1 | Adobe Photoshop Elements 2024 | Elements XXL 11 | Paint.Net
MarlonB
Posts: 29
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

masterjp wrote: Tue Apr 06, 2021 11:35 am Maybe your sorting filter is set to another entry?
I might be mistaken when sorting... I see you set the sort order by selecting the order with those two green arrows, I just pressed the column header.
masterjp wrote: Tue Apr 06, 2021 11:35 am Maybe you use a "o" and not a "0" (=zero)?

Try to rename the folder with "0000" to "test" and rename it back to "00000".
No, I'm sure of that (and renaming a few test files didn't change anything).
masterjp wrote: Tue Apr 06, 2021 11:35 am Sort by name should work perfect.
I agree :)

I've changed the sort order via the green arrows to "Name (not numeric) + Ascending", and now the sort order for files is correct. For folders, however, the sort order remains incorrect, even after prepending the folders:
Image

As you can see, the order is incorrect - abpea-f should not follow abpeaf, it should follow abpea and come before abpea2. Changing the order via column sort only reverses the (incorrect) order, changing the sort order via the green arrows doesn't change anything, and changing "folders always sorted alphabetically" doesn't affect the sort order either.

Thanks,

Marlon

PS: when I set the sort order to "name", a little up arrow appears on the name column indicating the sort order. However, this arrow does not appear when I select "name (numeric)" - I find this odd, since the sort is still being performed on the name column (even though the sort is different).
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Files and folders are not correctly sorted

Post by xnview »

MarlonB wrote: Tue Apr 06, 2021 7:19 pm As you can see, the order is incorrect - abpea-f should not follow abpeaf, it should follow abpea and come before abpea2. Changing the order via column sort only reverses the (incorrect) order, changing the sort order via the green arrows doesn't change anything, and changing "folders always sorted alphabetically" doesn't affect the sort order either.
You have the same order as Windows explorer
Pierre.
MarlonB
Posts: 29
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

xnview wrote: Wed Apr 07, 2021 6:53 am You have the same order as Windows explorer
I never said the Windows explorer order was the correct one :|

When I'm working with a lot of files, I tend to switch between the command line and my image viewer (which has become XnView MP since a year or so). In the command line, the sort order is correct and as it should be - alphabetically / ascii sorted, which is what I expected to get when I sorted in XnView.

So basically there's no option at the moment to perform an alphabetical sort on a column?
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Files and folders are not correctly sorted

Post by xnview »

will be added, See issue for current status and some details.
Pierre.
MarlonB
Posts: 29
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

xnview wrote: Sun Apr 11, 2021 11:38 am will be added, See issue for current status and some details.
Awesome - thank you!
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Files and folders are not correctly sorted

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.98.3. Please check and confirm the bug fix here.
Pierre.
MarlonB
Posts: 29
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

xnview wrote: Thu May 06, 2021 2:07 pm This problem is supposed to be fixed in XnView MP 0.98.3. Please check and confirm the bug fix here.
I've downloaded version 0.98.3 and verified the examples I kept, and I can confirm that the bug fix works.

Thank you very much, not only for resolving the issue, but especially for resolving it so quickly!
Post Reply