Additional sort order by exif fields

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
vukisz
Junior Member
Junior Member
Posts: 4
Joined: 2022-05-30, 06:43 UTC

Additional sort order by exif fields

Post by *vukisz »

Hello.
Additional sort order does not work as expected for me.

Custom columns setup:
Image: https://i.imgur.com/NTJagDB.png

View mode setup:
Image: https://i.imgur.com/hSL9wWd.png

Result Correct sort by TimeH, but not by DateM and DateH:
Image: https://i.imgur.com/mtZ3scf.png
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Additional sort order by exif fields

Post by *nsp »

I confirm the bug for date/time formatter...
It seems that the exif.OriginalTime.H order is in fact the same as exif.OriginalTime, you could try with Time.M you will see that even sort is not working ..
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Additional sort order by exif fields

Post by *white »

How the dates in the normal Date column is displayed in your country, doesn't effect the sorting. Sorting is done on the property value, not on how it is displayed. The same applies to custom columns.

Related: TC7.03 Sort on custom column with substring of plugin value
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Additional sort order by exif fields

Post by *ghisler(Author) »

Sorting is done on the property value, not on how it is displayed.
That's correct and intentional, see my reply there.
Author of Total Commander
https://www.ghisler.com
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Additional sort order by exif fields

Post by *nsp »

It could be intentional but annoying to not be able to force sorting of column as it was text or using extracted value only from formater.
vukisz
Junior Member
Junior Member
Posts: 4
Joined: 2022-05-30, 06:43 UTC

Re: Additional sort order by exif fields

Post by *vukisz »

I cannot clearly understand you all ;-)
So there is no bug and I cannot sort by Hour, and then by Month and Day (if hour is same)?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Additional sort order by exif fields

Post by *Horst.Epp »

vukisz wrote: 2022-06-07, 11:49 UTC I cannot clearly understand you all ;-)
So there is no bug and I cannot sort by Hour, and then by Month and Day (if hour is same)?
No, there is no general problem to sort by date and time.
Read the thread again.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Additional sort order by exif fields

Post by *white »

vukisz wrote: 2022-06-07, 11:49 UTC So there is no bug and I cannot sort by Hour, and then by Month and Day (if hour is same)?
Correct
vukisz
Junior Member
Junior Member
Posts: 4
Joined: 2022-05-30, 06:43 UTC

Re: Additional sort order by exif fields

Post by *vukisz »

To be honest I did not understood that thread, because I was not aware of any custom column manipulations
Adding full [=exif.DateOriginal] and [=exif.Time] in front of DateM DateD and TimeH I finally understood. So it means, that even if it shows, that it is sorted by TimeH it is really sorted by full =exif.Time which could be on a different Month-day
Image: https://i.imgur.com/iRRONZS.png

Thanks for explanations! :-)

P.S. If anyone interested I was doing hyperlapse photos over a few months and needed to delete night shoots. And "night shot" time is different between April and June ;-).
Resolved by just sorting by ISO. Those with high ISO were night shots which I needed to remove.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Additional sort order by exif fields

Post by *ghisler(Author) »

Just let me give you a simple example:
[=exif.DateOriginal.M-D-Y]
This would be the EXIF date shown the American way, month-day-year. Now I can't just sort alphabetically, because otherwise the years would be sorted last. I can't sort numerically because there are 3 numbers, even with "minus" signs (or slashes if you prefer M/D/Y), and sorting number by number would also sort the year last.
Author of Total Commander
https://www.ghisler.com
vukisz
Junior Member
Junior Member
Posts: 4
Joined: 2022-05-30, 06:43 UTC

Re: Additional sort order by exif fields

Post by *vukisz »

ghisler(Author) wrote: 2022-06-07, 15:07 UTC Just let me give you a simple example:
[=exif.DateOriginal.M-D-Y]
This would be the EXIF date shown the American way, month-day-year. Now I can't just sort alphabetically, because otherwise the years would be sorted last. I can't sort numerically because there are 3 numbers, even with "minus" signs (or slashes if you prefer M/D/Y), and sorting number by number would also sort the year last.
Correct me if I am wrong, but I believe that this answer was intended to be in this thread: viewtopic.php?t=12478 :-)
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Additional sort order by exif fields

Post by *nsp »

An intermediate solution is to extract what you need using vbscript and WinScript Advanced content plugin
See a sample code to extract exif Original Date/Time elements and Digitalized Date/Time elements using WIA.ImageFile Object (Windows 7 and newest) You can find exif propertyID in decimal as Tag Dec.
This is just a Sample you can adapt to your needs. But do not go above 20 fields by script !
Scripts\exif.vbs

Code: Select all

Dim oImg 
Set oImg = CreateObject("WIA.ImageFile")
Dim i 

oImg.LoadFile(filename)
If ( oImg.Properties.Count > 0 ) Then
      Dim fdow 'First Day of Week (0:Sunday,1:Monday...)
      fdow = 0
      'Dates are YYYY:MM:DD HH:mm:SS
      Dim out
      out = 0
      For Each p In oImg.Properties
      
        if ( p.PropertyID = 36867   )Then 
          content  = p.value
          content1 = MID(p.value,1,4)
          content2 = MID(p.value,6,2)
          content3 = MID(p.value,9,2)
          content4 = MID(p.value,12,2)
          content5 = MID(p.value,15,2)
          content6 = MID(p.value,18,2)
          content14 = Weekday(content1&"-"&content2&"-"&content3,fdow)
          out = out+1
        End If
        if (p.PropertyID = 36868   )Then 
          content7 = p.value
          content8 = MID(p.value,1,4)
          content9 = MID(p.value,6,2)
          content10 = MID(p.value,9,2)
          content11 = MID(p.value,12,2)
          content12 = MID(p.value,15,2)
          content13 = MID(p.value,18,2)
          content15 = Weekday(content8&"-"&content9&"-"&content10,fdow)
          out = out + 1
        End If  
        if (out = 2 ) then
          Exit For
        end if
      Next
End If
Option.ini

Code: Select all

[Script] 
ActiveScripts=xxif

[exif]
Script=Exif.vbs
content=exifDTOriginal
content1=exifDTOriginal-Y
content2=exifDTOriginal-M
content3=exifDTOriginal-D
content4=exifDTOriginal-Hour
content5=exifDTOriginal-Min
content6=exifDTOriginal-Sec
content7=exifDTDigitalized
content8=exifDTDigitalized-Y
content9=exifDTDigitalized-M
content10=exifDTDigitalized-D
content11=exifDTDigitalized-Hour
content12=exifDTDigitalized-min
content13=exifDTDigitalized-Sec
content14=exifDTOriginal-wd
content15=exifDTDigitalized-wd
extensions=jpg
FoldersPaths=0
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Additional sort order by exif fields

Post by *Hacker »

Christian,
Just let me give you a simple example:
[=exif.DateOriginal.M-D-Y]
This would be the EXIF date shown the American way, month-day-year. Now I can't just sort alphabetically
  1. You can try and use a nice piece of code in AHK to convert almost any date / time format to the AHK standard YYYYMMDDHH24MISS value. It is under public domain so you can either use it directly or for inspiration.
  2. You can use some regex with the appropriate delimiters to try and determine if it's a date in some format and treat and sort it as date. If it does not match the regex, treat it as a string.
  3. Support only numerical and string values and document that dates are not supported.
Any of these options is better than the current situation.

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
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Additional sort order by exif fields

Post by *ghisler(Author) »

1. I'm already sorting by date when the user uses a date field, so trying to detect a date from code wouldn't help here. The problem is that the user can combine parts of various fields with almost any complexity here, so I can't know by what I should sort.
Author of Total Commander
https://www.ghisler.com
Post Reply