-struct and a small feature request

Started by herb, April 30, 2018, 05:13:46 AM

Previous topic - Next topic

herb

Hello Phil,

A short time ago a started to work with DarwinCore tags (please see https://exiftool.org/forum/index.php/topic,9104.0.html).
Here I had also to learn how structures are handled by Exiftool and how structures are to be used on commandline interface.
Thanks for the excellent documentation on your internet page https://exiftool.org/struct.html.

In order to e.g. display all available tags my C++ application sends to Exiftool
exiftool.exe -t -H  -g0:1 ... <file> or
exiftool.exe -t -H  -G0:1 ... <file>
(and I do not use other options responsible for formatting)

and the response is a TAB separated table that contains the (hexadecimal) tag-number in column 1 for e.g. Exif or IPTC tags.
For XMP tags in column 1 is minus "-".

In a future version of my application I will also ask for structured output using
exiftool.exe -t -H -g0:1 -struct ... <file> or
exiftool.exe -t -D -G0:1 -struct ... <file>


Now I have a small request which would help my application to recognice which line is really a list or structure.
Instead of "-" Exiftool should write a plus "+" (or another character different to "-") into column 1 for XMP listtype tags and XMP structures.
(From my point of view the "+" could also be given in case of -H or -D is used without -struct.)

I ask for this modification in order to be very sure that a structure or list is to be parsed.
In theory the value of a tag could also be a string starting with "[" or "{" and having these characteres more than once, without being a list or structure.
For me the interface change is only a small one (but an helpful one), because the "-" is more a dummy to guarantee the table structure than a "real information". 

Hoping that you will agree I say thanks in advance.
Best regards
Herb

Phil Harvey

Hi Herb,

I suppose you are using -t instead of -j because it is more convenient.  However, I might suggest switching to -j because you won't have this problem.  Also, it may have features that you find useful in the future.

I could implement your suggestion, but it changes the current behaviour, which may affect other people who are using -D or -H with -struct (although I admit, this would be a small subset of ExifTool users).  I would have to think seriously about it before making a change like 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 ($).

herb

Hello Phil,

thanks that you will look closer to "this problem" and thanks for the suggestion to use -j option instead of -t option.
You should know that a feature of my application is to display tags and there values translated (in my case into German) using -lang de.
And yes at the moment I work only with flattened tags/tagnames.

I had a very very short look on the output with -j option used and I have seen a small disadvantage. (Please do not misunderstand).
With -j option only the tag-values are translated in case of -lang is used.

But also in case -t option is used together with -struct and -lang
- only the tag-name is translated
- but the tags/tagnames inside a structure are also not translated.

At the moment I do not know which is the best solution.

Thanks again
Best regards
Herb

Phil Harvey

Hi Herb,

You can add -l to the -j option to also see the descriptions.  It is the descriptions that are affected by the -lang option.  Tag names and structure field names are always English.

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

herb

Hello Phil,

thanks for so many help; for all your hints and proposals.
Sorry also for my late reply; but I was out of office for some days.
Now I will start to do my exercises and my homework.

But my obligatory question: Can you imagine that structure field names are also translated into a foreign language
- from technical point of view and also
- from "output interface" point of view.

Best regards
Herb

Phil Harvey

Hi Herb,

Implementing translations for structure field names would be quite a bit of work.  Not likely to happen in the foreseeable future given the lack of demand.

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