ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: VlCTOR on December 21, 2017, 08:22:50 AM

Title: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 21, 2017, 08:22:50 AM
Hello, Phill.
I am using Windows 7 x64 with Exiftool 10.69
I am in need for command such as exiftool(-CodedCharacterSet=UTF8).exe
But performing of this command leads to incorrect tag record - the IPTC tag CodedCharacterSet value is written such as "U T F 8" (with unnecessary spaces between the characters).
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 21, 2017, 08:35:36 AM
The tag is being written correctly.  Is that ExifToolGUI that you are using to display it?  If so, I don't know why it is seemingly inserting spaces.  The actual value written to the file should be ESC % G (3 bytes, no spaces), but this is converted to the string "UTF8" when extracted by ExifTool.

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 21, 2017, 12:13:34 PM
Oh no.

When I use the command line or ARGFILE, the tag is written correctly (see Ok.jpg).
But when I use inside brackets in the name of the stand-alone executable or use an additional parameter in the program "Geotag", the tag is written incorrectly (see Err.jpg)
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 21, 2017, 12:18:12 PM
Post a small JPG file with the CodedCharacterSet as written using the brackets technique and I'll take a look.

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 21, 2017, 02:02:50 PM
Oh, my God.
I'm a little messed. The problem only appears when call ExifTool from the "Geotag" program (http://geotag.sourceforge.net/)
See setting of Geotag (tag with unnecessary spaces inside).
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 21, 2017, 02:05:07 PM
Right.  Geotag is writing this incorrectly.

Ah.  I can get ExifTool to write this incorrectly if the -n option is used when writing "UTF8".  But this is an operator error.  If written with -n, the value should be "\x1b$G" (ESC % G).

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 21, 2017, 02:49:47 PM
How can I use it?
I get "\ x 1 b   $  g" or "E S C %   g" in the tag CodedCharacterSet.
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 21, 2017, 04:30:09 PM
Quote from: VlCTOR on December 21, 2017, 02:49:47 PM
How can I use it?

We have some language difficulty here.  I don't understand the question.

CodedCharacterSet was written incorrectly.

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 21, 2017, 04:43:00 PM
Quote from: Phil Harvey on December 21, 2017, 02:05:07 PM
If written with -n, the value should be "\x1b$G" (ESC % G).
How to apply it in command line?
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 22, 2017, 07:01:36 AM
Good question.  I don't know how to generate an ESC character on the Windows command line.

CodedCharacterSet should be written like this on the command line:

exiftool -codedcharacterset=UTF8 FILE

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 22, 2017, 08:57:39 AM
To generate an ESC character on the Windows command line simultaneously press ALT and 27 (decimal character code) on the numpad.
But it doesn't work. We have the same problem:
C:\101MSDCF\origin>exiftool -n -codedcharacterset="←%G" 1.jpg
    1 image files updated
C:\101MSDCF\origin>exiftool -codedcharacterset 1.jpg
Coded Character Set             : < % G
C:\101MSDCF\origin>exiftool -n -codedcharacterset="\x1b$%G" 1.jpg
    1 image files updated
C:\101MSDCF\origin>exiftool -codedcharacterset 1.jpg
Coded Character Set             : \ x 1 b $ % G

Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 22, 2017, 10:20:21 AM
Nice try.

But I don't know why you are trying to do this.

Use the command I gave earlier to set CodedCharacterSet properly.

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 25, 2017, 02:54:19 PM
Geotagging and geonaming are the first thing I do to manage my photos. To do this I use Geotag program.
Geotag utilizes Exiftool to record user's data in IPTC with UTF8 encoding. It uses hidden and fixed key - m.
The second step is using Exiftool to copy data from IPTC to XMP and also adding key words and other personal data from argfile.
-Codedcharacterset=UTF8 is the first command in argument file.
But despite of that, the data from IPTC copies to XMP incorrectly.
This happens because codedcharacterset=UTF8 doesn't take effect until complete recording of all data.
That's why I'd like to record codedcharacterset=UTF8 at the first step - to eliminate the unnecessary step between steps 1 and 2.
This has essential meaning in processing a lot of photographs.
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 25, 2017, 07:48:30 PM
Quote from: VlCTOR on December 25, 2017, 02:54:19 PM
-Codedcharacterset=UTF8 is the first command in argument file.
But despite of that, the data from IPTC copies to XMP incorrectly.

The IPTC is decoded based on the existing CodedCharacterSet, not the one you are just writing.  So you may need a separate step to write CodedCharacterSet properly before copying the IPTC to XMP.  Alternatively, you can set -charset IPTC=UTF8 to force IPTC to be read as UTF8.

QuoteThis happens because codedcharacterset=UTF8 doesn't take effect until complete recording of all data.

Exactly.

QuoteThat's why I'd like to record codedcharacterset=UTF8 at the first step - to eliminate the unnecessary step between steps 1 and 2.

Yes, but that isn't what I was asking.  I was asking why you are trying to write the numeric value of this tag (ESC & G) instead of writing the converted value ("UTF8").  Regardless, I will add a check in the next ExifTool version to prevent you from writing "UTF8" as the numeric value for this tag, and will translate it automatically to "ESC & G" regardless of whether or not -n was used.

- Phil
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: VlCTOR on December 26, 2017, 05:25:57 PM
Quote from: Phil Harvey on December 25, 2017, 07:48:30 PM
Alternatively, you can set -charset IPTC=UTF8 to force IPTC to be read as UTF8.
Excellent hint!
After adding the following lines to the argfile:
-charset
iptc=UTF8

the UTF8 encoding data copied correctly  from IPTC to XMP.

Quote
I was asking why you are trying to write the numeric value of this tag (ESC & G) instead of writing the converted value ("UTF8").
I tried to do this for the reason that the Geotag program always uses -n when calling Exiftool.
It's not my choice. This is idea of the Geotag authors.

Quote
Regardless, I will add a check in the next ExifTool version to prevent you from writing "UTF8" as the numeric value for this tag, and will translate it automatically to "ESC & G" regardless of whether or not -n was used.
Great idea, Phil. This is the best solution.
Title: Re: Issue when simple options were added inside brackets in the name of the stand-al
Post by: Phil Harvey on December 26, 2017, 07:18:12 PM
Quote from: VlCTOR on December 26, 2017, 05:25:57 PM
I tried to do this for the reason that the Geotag program always uses -m when calling Exiftool.

Ah. (-n though).  I see.

- Phil