fileOrder is ineffective in case of accentuated letters in the file path.

Started by JlrJlr, March 08, 2021, 02:02:26 PM

Previous topic - Next topic

JlrJlr

Hello

If there are accentuated letters in the file path the recommended method to transmit DIR is to use a list text file in UTF-8

I am using this every time (french is full of é ê è and so on) it works very well, until I had to number files based of DateTimeOriginal.

In this case it seems to work well, no error messages, but files number were not in the order of DateTimeOriginal.

Flowing an example of the result :



File zDirList1.txt contains one line

..\TFilOrdétêtè

The directory of the 6 test files. Only the last dir of the full path is shown here.

In case  "TFilOrdétêtè"  does not display well on non french terminal due to accents it is "TFilOrdetete"  where the 3 e's are with various accents.


\exiftool -ver
12.21
Windows 10




>\exiftool  -a -G0 -s -f  -FileName -EXIF:DateTimeOriginal   -fileOrder DateTimeOriginal -ext jpg  -charset filename=utf8   -@ "C:\Users\jlkre\Documents\Progs\ExifTool\zDirList1.txt"


======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/20210216_111437.jpg
[File]          FileName                        : 20210216_111437.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:35
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/20210216_111459.jpg
[File]          FileName                        : 20210216_111459.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:57
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/20210216_111551.jpg
[File]          FileName                        : 20210216_111551.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:51
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/b_20210216_111446.jpg
[File]          FileName                        : b_20210216_111446.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:44
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/b_20210216_111520.jpg
[File]          FileName                        : b_20210216_111520.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:19
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/b_20210216_111540.jpg
[File]          FileName                        : b_20210216_111540.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:39
    1 directories scanned
    6 image files read

Files are ordered according to 'FileName" not "DateTimeOriginal"


If the same test is run on the directory "TFilOrdetete" the result is as expected.

======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/20210216_111437.jpg
[File]          FileName                        : 20210216_111437.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:35
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/b_20210216_111446.jpg
[File]          FileName                        : b_20210216_111446.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:44
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/20210216_111459.jpg
[File]          FileName                        : 20210216_111459.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:57
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/b_20210216_111520.jpg
[File]          FileName                        : b_20210216_111520.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:19
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/b_20210216_111540.jpg
[File]          FileName                        : b_20210216_111540.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:39
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdetete/20210216_111551.jpg
[File]          FileName                        : 20210216_111551.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:51
    1 directories scanned
    6 image files read


A obvious workaround, that use today, is to move all files to a plain letters directory.

If this cannot be fixed (as I understood from previous post, those issues of Utf-8 are not easy to fix and very specific to windows) maybe a warning message.

Thanks for the hard work you put on Exiftool.


Phil Harvey

I don't see why this should be related to the UTF-8 filenames.  ExifTool is finding the files that you specify.

But I can't reproduce this effect on the Mac, so it seems there is something I'm not understanding.

If you keep everything the same but rename the directory to use only ASCII characters (and change the name in the .txt file), is the output then sorted properly?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

JlrJlr

Thanks for your answer

"I don't see why this should be related to the UTF-8 filenames."
It is not UTF-8 per say but acentued letter such as è

"If you keep everything the same but rename the directory to use only ASCII characters (and change the name in the .txt file), is the output then sorted properly?"
This is the second example with directory name "TFilOrdetete" (same e's without accent.)


Phil Harvey

Quote from: JlrJlr on March 08, 2021, 05:55:48 PM
This is the second example with directory name "TFilOrdetete" (same e's without accent.)

Right.  Thanks.  I'll look into this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

JlrJlr


I did more investigation.
It turns out that when the DIR is on the command line the result is as expected !.

I have simplified the test only 3 files a, b, c, such that in " date order" there are c, b, a
I have added -V1 see the results below (I have removed the bloc of all data report)

I notice a difference in the trace between the  run "DIR on command line" and "DIR in file"
-"DIR on command line"  : Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd.t.t.
-"DIR in file" : Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd..t..t..


>rem DIR given directly form run argument
>\exiftool -v1 -a -G0 -s -f  -FileName -EXIF:DateTimeOriginal  -fileOrder DateTimeOriginal -ext jpg  \TFilOrdétêtè


Warning = FileName encoding not specified
FileName encoding not specified.  Use "-charset FileName=CHARSET"
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdtt/c.jpg
  ExifToolVersion = 12.21
  FileName = c.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd.t.t.
  Warning = FileName encoding not specified
  FileSize = 3141899
  FileModifyDate = 1614610399.85633
  FileAccessDate = 1615284230.1362
  FileCreateDate = 1615283210.45109
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : c.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:35
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdtt/b.jpg
  ExifToolVersion = 12.21
  FileName = b.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd.t.t.
  Warning = FileName encoding not specified
  FileSize = 4811935
  FileModifyDate = 1614609309.25052
  FileAccessDate = 1615284230.12612
  FileCreateDate = 1615283210.46671
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : b.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:19
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdtt/a.jpg
  ExifToolVersion = 12.21
  FileName = a.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd.t.t.
  Warning = FileName encoding not specified
  FileSize = 7594137
  FileModifyDate = 1614610402.6374
  FileAccessDate = 1615284230.12612
  FileCreateDate = 1615283210.45109
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : a.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:51
    1 directories scanned
    3 image files read



>rem DIR given via arg file in UTF8
>\exiftool -v1 -a -G0 -s -f  -FileName -EXIF:DateTimeOriginal   -fileOrder DateTimeOriginal -ext jpg  -charset filename=utf8   -@ "l\zDirList1.txt"


======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/a.jpg
  ExifToolVersion = 12.21
  FileName = a.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd..t..t..
  FileSize = 7594137
  FileModifyDate = 1614610402.6374
  FileAccessDate = 1615284230.37041
  FileCreateDate = 1615283210.45109
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : a.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:51
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/b.jpg
  ExifToolVersion = 12.21
  FileName = b.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd..t..t..
  FileSize = 4811935
  FileModifyDate = 1614609309.25052
  FileAccessDate = 1615284230.30141
  FileCreateDate = 1615283210.46671
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : b.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:15:19
======== C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdétêtè/c.jpg
  ExifToolVersion = 12.21
  FileName = c.jpg
  Directory = C:/Users/jlkre/_NoHistory/ExifTool/TFilOrd..t..t..
  FileSize = 3141899
  FileModifyDate = 1614610399.85633
  FileAccessDate = 1615284230.21677
  FileCreateDate = 1615283210.45109
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
[File]          FileName                        : c.jpg
[EXIF]          DateTimeOriginal                : 2021:02:16 11:14:35
    1 directories scanned
    3 image files read

Phil Harvey

The difference is probably -charset filename=utf8 that you aren't using on the command line.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

JlrJlr

Thanks for this  answer

The intersting thing, of this last case of DIR given in argument, is that the file order is by date as expected.

Here is the result of adding charset


exiftool -v1 -a -G0 -s -f  -FileName -EXIF:DateTimeOriginal  -fileOrder DateTimeOriginal -ext jpg -charset filename=utf8 C:\Users\jlkre\_NoHistory\ExifTool\TFilOrdétêtè

Warning = Malformed UTF-8 character(s)
Error: File not found - C:/Users/jlkre/_NoHistory/ExifTool/TFilOrdtt

Phil Harvey

You would need to change your console to UTF-8 as well for this to work.

But I think I may have enough information now to track this down (when I get a chance).

Thanks.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).