ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: msdobrescu on March 20, 2013, 08:07:40 AM

Title: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 08:07:40 AM
Hello,

Is there a way to assign two tags at once?

like: -Xmp:Subject=Iptc:Keywords=...

Thank you.
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 08:14:30 AM
To maintain synchronization between XMP and IPTC, take a look at the MWG tags (https://exiftool.org/TagNames/MWG.html).

Or to assign the same value to any number of arbitrary tags, you can create a shortcut in the config file (https://exiftool.org/config.html) and assign a value to the shortcut tag.

- Phil
Title: Re: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 09:02:06 AM
OK, but what if I have different workflows?
Let's say I need to group tag A with B in 50% of daily work, and A with C in the other 50%?
Isn't it easier to have these A=B=... constructs? ...for the users, of course.
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 10:25:52 AM
This can't be implemented as suggested because the argument syntax "-TAG1=TAG2=VALUE" is not compatible with the existing behaviour which would be to assign the value "TAG2=VALUE" to TAG1.

In your scheme, how would I assign the value "XXXX=YYYY" to a tag?

- Phil
Title: Re: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 10:30:31 AM
I don't know the implementation details, it's just a theory.
Some articles say that Perl could do that, so it could be used as (tag1, tag2) = ..., if I understood well.
The tool is in Perl, after all, and many things could be done using Perl syntax, isn't it?
I'm totally new to Perl, so I can't propose a real solution.
Any syntax that would simplify the usage is welcome.
It's just an idea.
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 10:45:19 AM
It isn't the Perl implementation I'm worried about -- that is easy.

It is the command-line interface.

- Phil
Title: Re: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 10:47:47 AM
I think that's your, I must say, *GREAT* work, so you decide how it is natural to do it from the usability point of view.
I'm too new to it to give a reasonable specification.
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 11:01:15 AM
Unfortunately I can see no way of doing this without introducing a new operator.  This would make an already confusing interface even more confusing, which I would rather avoid.

- Phil
Title: Re: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 11:03:51 AM
Well, it worths if I could avoid making config files...
Comparing to that, it's much easier for me.
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 11:08:23 AM
Or you could just do this:

exiftool -TAG1=VALUE -TAG2=VALUE FILE

- Phil
Title: Re: Assign two tags at once
Post by: msdobrescu on March 20, 2013, 11:13:57 AM
Of course, if I could avoid maximum length of the command line, which is 8k on the Windows 7.
Just maintainability could be an issue, where I have to care of, let's say, 50 kw twice, or same regex expression and so on.
I know, I could set them once and copy them, meaning doing several times (hopefully only twice) the files processing.
This means multiplying the processing time by 2 at least.

If there is no big deal to implement, better have some option not so often used by some, if it looks scary to them, than none.
I guess it is not easy also...
Title: Re: Assign two tags at once
Post by: Phil Harvey on March 20, 2013, 11:44:42 AM
There is the -@ option if command length is a concern.

Or the -TAG<=FILE syntax if your tag values are very large.

- Phil