Feature request: handling of white space and partial structure filling

Started by Archive, May 12, 2010, 08:54:45 AM

Previous topic - Next topic

Archive

[Originally posted by anvoit on 2010-02-21 13:28:36.950512-08]

Hi Phil,

I'm still thinking about the possibilities to enhance exiftool so it can handle empty strings and fill partial structures.

1) Empty strings, white space text or text with trailing white space

a) This is mainly a problem when using the -@ argument file feature as exiftool trims trailing and leading white space when reading the file. So first the ideas for the -@ argument files:

One solution would be not to trim white space or to have a flag which disables white space trimming.

Another possibility would be to allow the use of double quotes ("). This would be quite easy to be added, as exiftool just needs to remove the first and the last double quote. Using this you can define any text just consisting of white space or having leading or trailing white space.

b) Creating empty tags on the command line

Right now it's not possible to create an empty tag on the command line, as the "--tag=" means that the tag is to be deleted.

One solution would be to use another character instead of the "=" char, e.g. "--tag+" or "--tag#". This would mean that the tag is just created with an empty value of the default value.

2) Filling partial structures

Currently the structure handling is not really satisfying as we discussed before in another thread. I need to fill all structure members with dummy values and need to delete these values in a second run.

One solution might be to have an option, let's say -end={structurename} which closes the named structure and any further assignment to a structure member will open a new structure.

Hope my ideas are clear enough and maybe help to find a solution.

Thanks for all your efforts,

Andreas

Archive

[Originally posted by exiftool on 2010-02-22 07:44:06.302858-08]

About the empty strings business.  I generally do no recommend adding
empty values.  Your problem of incomplete structures is the only case
where I can see that this could be useful.  Otherwise I would usually
recommend deleting a tag rather than adding an empty value
(which is what exiftool currently does).

The structure feature will be a fair bit of work to implement.  I'm
actually thinking of defining a syntax something like this to allow
writing of a complete structure (the -struct option would
be used to enable this feature):

Code:
exiftool -struct -derivedFrom+="{documentID=>'my id', manager=>'a manager'}"

- Phil

Archive

[Originally posted by anvoit on 2010-02-22 22:52:11.054008-08]

Hi Phil,

about the empty and white space subject: honestly, I disagree. The possibilities setting tags on the command line and in the argument file should be the same but they are not.

Second, how can I set a tag to a string just having one or several blanks? That's impossible using the argument file. And what's about leading and trailing blanks?

About the structure feature: this seems to be a nice way. How are lists specified with this syntax?

Andreas

Archive

[Originally posted by exiftool on 2010-02-23 05:00:14.550351-08]

Hi Andreas,

I forgot to comment on the problem with spaces in
the -@ file.  You're right there should be a way
to do this.  I'll have to think about this.

The syntax for lists could be:

"-mystruct={tag=>value, list=>['value 1','value 2','value 3']}"

But don't get your hopes up too high.  As I said, implementing this
would be a lot of work.  Not the least of which is updating all of the
documentation, including the tag name documentation, for the
new structure feature (without making it too confusing).

- Phil

Edit: This feature was added in Jan. 2011 to ExifTool 8.44

Archive

[Originally posted by exiftool on 2010-02-25 08:21:58.454696-08]

Hi Andreas,

I was kindly reminded of the -E and -ex
options in another thread.  Either of these options may be used
to solve your problem with spaces in the -@ file
because they allow you to insert HTML/XML character
entities in tag values (ie. " ").

This works for special characters in tag values both on the
command line and in -@ files.

Of course, if you use this technique it is advisable to escape
ampersands (&) with "&" (although not strictly
necessary because exiftool not translate anything which isn't
a recognized character entity).

- Phil