Unexpected Sort Profile Behaviour

Started by afengler, March 13, 2023, 09:31:24 PM

Previous topic - Next topic

afengler

When using the Sort Profile "File Format", my 3 file types are displayed in the order:
ARW
TIF
JPG.
I was expecting an alphabetic sort. Not a problem, just confusing at first.

IMatch 2021.18.4 (64-bit) Win 10 Pro

Mario

This profile does not sort by extension (!) but by the name of the format (id). By the name IMatch assigns to the format, which may (usually will) differ from the file format extension.

You can e.g. see the file format by using the corresponding attribute in a File Window Layout or by looking at the {File.Format} variable.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afengler

Interesting. The {File.Format} sequence is
SONY
TIFF
JPG
which is also not alphabetic but perhaps based on some internal IMatch list?

sinus

#3
Hmm.  :o

I have no idea.
I have the same results as afengler here.
If I use VarToy, I get:

Ext = {File.Ext}
ExtS = {File.ExtS}
Format = {File.Format}

Ext = psd
ExtS = psd
Format = PSD

Ext = tif
ExtS = tif
Format = TIFF

Ext = nef
ExtS = nef
Format = NEF

Ext = jpg
ExtS = jpg
Format = JPEG

Ext = png
ExtS = png
Format = PNG

What I wonder, that Ext and ExtS give always the same result. But this is true since a very long time, so this maybe has nothing to do with the problem here.

But the difference with File.Format is not very big, it uses capital letters and e.g. JPEG instead jpg.

Best wishes from Switzerland! :-)
Markus

Mario

Quote from: afengler on March 14, 2023, 06:27:34 AM... which is also not alphabetic but perhaps based on some internal IMatch list?
Correct.
If you want to sort files by their extension alphabetically, sort by "File Extension", not by by file format.

Quote from: sinus on March 14, 2023, 07:10:19 AMWhat I wonder, that Ext and ExtS give always the same result.

A relic from olden times, or for users who still have to deal with FAT-formatted media.
From the IMatch help:

"These variables are identical to the variables without the "S", but use the short file names supplied by Windows."

On FAT drives when extensions with more than 3 characters were used (.aphoto), not all applications worked with that so Windows provided a shortened file name and extension. These variables give you access.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afengler

Thanks. New profile 'File Extension' works fine.