Author Topic: Win32/FindFile error using ExifTool 9.81  (Read 10659 times)

Thomas

  • Jr. Member
  • **
  • Posts: 26
Win32/FindFile error using ExifTool 9.81
« on: January 12, 2015, 05:46:20 PM »
Hi, Phil,

I use ExifTool with Windows 8.1. When exctracting meta data (with the -p option) into a csv file, I keep getting an error report using version 9.81: "Malformed UTF-8 character (unexpected non-continuation byte 0x72, immediately after start byte 0xe4) in goto at Win32/FindFile.pm line 71." With different values instead of 0x72. Perhaps the known issue with representation of characters in Windows? I tried different -charset options but that didn't alter or eliminate the error report. As I think I used the command without any problems previously, I installed ExifTool version 9.70 and the error report did not show up: extracting worked fine. I'm not an expert but I thought you might be interested. Did I do anything wrong?

Kind regards,
Thomas

PH Edit: Moved to bug reports and changed subject to be a bit more descriptive
« Last Edit: January 14, 2015, 09:35:13 AM by Phil Harvey »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Error report using ExifTool 9.81
« Reply #1 on: January 12, 2015, 08:50:27 PM »
Hi Thomas,

Are you specifying a directory name that contains special characters?  If so, you must now indicate what encoding you are using by adding -charset filename=CHARSET option to your command (where CHARSET is the character set you are using for the directory name).

Yes, this is different with the previous behaviour, but has the advantage that it should now provide full Unicode support for file names (once we figure out the problem you are having anyway).

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Error report using ExifTool 9.81
« Reply #2 on: January 14, 2015, 09:16:04 AM »
I should have also referred you to the Windows Unicode File Names section of the application documentation.

I will be adding some checks and improved warnings to version 9.82 to help with this.

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

Thomas

  • Jr. Member
  • **
  • Posts: 26
Re: Win32/FindFile error using ExifTool 9.81
« Reply #3 on: January 14, 2015, 04:07:32 PM »
Hi, Phil,

sorry for not having read that part of the application documentation. Yes, I do specify directory names with special characters (german umlauts). But I'm not sure if I understand you correctly. The -charset option refers to the picture files, right? Therefore - as I understand - I should have used e.g. -charset "F:\Pictures\Vacation 2014"=UTF8. I.e. just the directory name, or does "When a directory name is provided, the file name encoding need not be specified (unless the directory name contains special characters)" have a different meaning?

What about the other direction (importing meta data from a csv file to picture files using the -csv option): Is there also an need to use the -charset option in the way you suggested?

Furthermore, does your hint in the application documentation that the -P option will not work with unicode names refer to a fundamental incompatibility or will it be possible in the future to use the -charset and -P options in a single command? That would be great or is there another alternative to -P that allows me to format the csv output file?

I suspect that part of the problem for me is simply a problem of language comprehension... Thanks for your great help!

Thomas


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #4 on: January 14, 2015, 08:49:13 PM »
Hi Thomas,

Not quite.  The "FileName" is literal:

exiftool -charset filename=utf8 "F:\Pictures\Vacation 2014"

But this example directory name doesn't have any special characters, so the -charset option would have no effect for this specific example.

Hmmm.  You also want to use special characters in CSV file names?  I haven't added support for this yet.  I'll have to look into this.

I think you may be confusing -P with -p-P preserves the file date/time, while -p is an output formatting option.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #5 on: January 15, 2015, 09:40:46 AM »
ExifTool 9.82 (to be released soon) will support Windows Unicode file names for input CSV and JSON files.

As well, I think I have solved the -P problem, so this should hopefully work with 9.82 as well.

- Phil

Edit: Version 9.82 is now available, and seems to fix the -P problem.
« Last Edit: January 15, 2015, 10:33:19 AM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Thomas

  • Jr. Member
  • **
  • Posts: 26
Re: Win32/FindFile error using ExifTool 9.81
« Reply #6 on: January 18, 2015, 03:52:46 PM »
Hi, Phil,

thank you for the explanations! I confused -p and -P... But hm...I still I haven' t got it yet. I tried the following using version 9.82:

exiftool -L -charset filename=UTF8 -p FormatCSVExport.fmt "F:\Bilder\Geburtstag" > "F:\Dateien\35jähriger Geburtstag.csv"

with the the fmt-file containing no Umlauts. Here I get no error messages. The csv-file is created correctly. Using -charset filename=Latin, I get a -csv-file but without those files listed that contain Umlauts in their names.

When I use a Umlaut in the directory name, i.e. "F:\Bilder\35jähriger Geburtstag", then I get one single error message "File not found: F:\Bilder\35jõhriger Geburtstag" when using UTF8 and several error messages for each file processed that it could not be found when using Latin.

Mentioning wildcards: I frequently use wildcards in directory names as "F:\Bilder\*\JPG". Does that work? Or will it work in the future? It would be great for me as otherwise using Umlauts would not work along with my hierarchical system of directories.

Any advice? Thank you!

Thomas
« Last Edit: January 18, 2015, 04:32:51 PM by Thomas »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #7 on: January 18, 2015, 08:05:19 PM »
Hi Thomas,

You are very good at using Unicode file names for things I hadn't thought about.

In this latest command you are attempting to redirect the ExifTool output to a Unicode-named output.

Unfortunately, this is beyond the realm of ExifTool.  I/O redirections like this (">") are handled by the Windows cmd shell, not ExifTool, so I can't help with this.

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

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 1140
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Win32/FindFile error using ExifTool 9.81
« Reply #8 on: January 19, 2015, 02:32:10 AM »
Phil,

I actually think he tried to explain the problem is with reading the directories with umlauts. These give him errors. The redirect goes fine.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #9 on: January 19, 2015, 07:07:56 AM »
Thanks Hayo.  I didn't read the post carefully enough.

I don't understand the problem where the csv file doesn't contain the files with umlauts -- I'll have to look into this.

The problem with a special character in the directory name must be a mismatch of the filename encoding and the -charset filename= character set.  Try putting the directory name in a UTF-8 text file and use -charset filename=utf8 -@ myfiles.txt to read the name.

The wildcards aren't likely to work in the near future.  I haven't been able to find a work-around for these. Doing this doesn't get what you want?: -r -ext jpg F:\Bilder

- Phil

Edit: As of ExifTool 9.85, wildcards should work too.
« Last Edit: March 13, 2015, 01:35:57 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Thomas

  • Jr. Member
  • **
  • Posts: 26
Re: Win32/FindFile error using ExifTool 9.81
« Reply #10 on: January 19, 2015, 03:37:45 PM »
Hi, Phil,
hi, Hayo,

not sure if this is a compliment, Phil :-) But how can you be made responsible for all those special characters in the world? To be serious, I'm a bit confused as I'm not an expert. Once I find well-trodden paths I keep using them when manipulating metadata... Prior to version 9.79 everything worked fine for me but I don't dare hoping that returning to the 'old world' is an option (suspecting that there are substantial numbers of languages concerned by the problem arising from incomplete system code pages in Windows). Anyhow, I guess Hayo is right in writing that I/O redirections are not problematic.

Using a UTF8-encoded txt file yielded the same result as before:

exiftool -r -L -p FormatCSVExport.fmt -charset filename=UTF8 -@ myfiles.txt > "F:\Dateien\35jähriger Geburtstag.csv"
File not found: "F:/Bilder/35jähriger Geburtstag"


Regarding wildcards I think -r -ext jpg F:\Bilder is the solution. Thanks for dedication, help, patience.

Thomas

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #11 on: January 19, 2015, 07:54:06 PM »
Hi Thomas,

Could you please attach the myfiles.txt file that you used?

Thanks.

- Phil

Edit:  I was hoping to settle this before I went on vacation tomorrow, but it appears we may run out of time.  When specifying file names, the behaviour of ExifTool 9.82 should be exactly the same as pre-9.79 versions (provided "-charset filename=" is NOT used), except that you should now get a warning: "FileName encoding not specified".  So if it worked before, it should still work now.  If it doesn't, please give the exact commands you used and the names of the files and I will sort out the problem after I get back in a week.
« Last Edit: January 20, 2015, 12:01:10 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Thomas

  • Jr. Member
  • **
  • Posts: 26
Re: Win32/FindFile error using ExifTool 9.81
« Reply #12 on: January 21, 2015, 03:20:15 PM »
Hi, Phil,

sorry, I'm late. Family kept me away from the PC. The txt file is attached. Omitting the -charset filename=UTF8 statement yields the same "not found"-warning when using the -@ myfiles.txt statement. With the directory name itself inserted in the exiftool statement everything works fine (besides the warning "FileName encoding not sspecified") as you described. In addition, I tried "F:/*/35jähriger Geburtstag", and it also worked.

Have a good holiday!
Thomas

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17243
    • ExifTool Home Page
Re: Win32/FindFile error using ExifTool 9.81
« Reply #13 on: January 29, 2015, 07:28:17 AM »
Sorry for the delay in responding, I've been on vacation.

Your myfiles.txt looks to be good UTF-8 to me, so I don't understand the problem.  I'll have to run some tests when I get a chance.

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

Thomas

  • Jr. Member
  • **
  • Posts: 26
Re: Win32/FindFile error using ExifTool 9.81
« Reply #14 on: January 29, 2015, 03:10:19 PM »
Hi, Phil,

thank you for your reply. Hm. Can you replicate the error messages?

Thomas