clean up IPTC Description/Caption field

Started by frereroy, May 18, 2018, 09:14:33 AM

Previous topic - Next topic

Phil Harvey

If you are passing special characters in file names on the command line, you must set the -charset filename=XXX option to set the character set to whatever you are using.  See here for more information.

- 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 ($).

frereroy

Thanks. Am using the -L switch (for Windows Latin1).

As the job progresses I see "funny" characters in the paths that contain accents but the filenames themselves, which do not contain accented characters, are treated correctly.

Phil Harvey

-L is for tag values.  The -charset filename=XXX option is for file/directory names.  There is some overlap because the FileName and Directory tags use both options.

Is the job working aside from seeing funny characters?  An where are you seeing them?

- 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 ($).

frereroy

I am now using the following command

Quoteexiftool -ext JPG  -charset filename=Latin -use MWG "-Description<${Description;s/\s+$// or $_=undef}" "-Caption-Abstract<${Caption-Abstract;s/\s+$// or $_=undef}" -overwrite_original -r /Phototheque

The job is working well but the accented directory names show as gobbledy-gook as the lines scroll through the command line box.

Phil Harvey

If you are talking about the file name after the "====" when processing multiple files, then yes.  There is currently no character translation for the informational messages.  I should maybe look into doing 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 ($).

frereroy

#20
I do not see the "===="

The funny thing is that if I write ".... -r /Phototheque" then all embedded directories with accents in their names will be processed albeit showing the odd characters on the screen while processing but if the top level directory contains an accent like ".... -r /Photothèque" then I get the error  "File not found". and the underlying directories are not parsed.


Phil Harvey

That's not funny at all.  Specifying file names with special characters is problematic as I said.  It can be done, but you must get your character sets correct.

- 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 ($).

frereroy

exiftool -ext JPG -use MWG "-Description<${Description;s/\s+$// or $_=undef}" "-Caption-Abstract<${Caption-Abstract;s/\s+$// or $_=undef}" -overwrite_original -common_args -charset filename=cp1252 -r /Photothèque


Now works. i.e. the top level directory is read correctly with it's accent and parsing the directories within works inspite of showing "odd" characters on the screen instead of the accented ones.

I was rather hoping that the -common_args tag that I added would correct this.