Multiple Tag Instances (or copies)

Started by Curtis, December 10, 2013, 02:35:39 PM

Previous topic - Next topic

Curtis

Quick question....

Some tags can occur multiple times in the same group.  For ExifTool are there any tags defined as writable that can have multiple instances within the same group or is the writable flag an indicator that there can only be one instance of the tag if  writable = true?  (ie writable = false can have more than one instance, but ExifTool could not write additional instances)

Bottom line question: How can I determine (from ExifTool) if it is valid to have/add more than one instance of a tag in the same group?

Thanks for any advice.
Curtis

Phil Harvey

There may be duplicate writable tags in the same group.  However, in family 1 groups, I think this should only happen in maker notes information (where there is often much duplication).

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

Curtis

OK... when that happens and I want to change a particular instance of a tag that occurs multiple times in a group, how do I indicate to ExifTool which instance I want to update?

Curtis

Phil Harvey

You don't.  ExifTool updates all existing same-named tags in the same group to maintain consistency.

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

Curtis

OK... but I did find one anomaly from that (after looking in 100's of files)...

In the Exiftool.jpg file in your test images it has two instances of File:Comment as shown below:

<File:Comment et:id='Comment' et:table='Extra'>© PhotoStudio Unicode comment
</File:Comment>
<File:CurrentIPTCDigest et:id='CurrentIPTCDigest' et:table='Extra'>6895be53ef9a287520f400aa17242c09</File:CurrentIPTCDigest>
<File:Comment et:id='Comment' et:table='Extra'>a comment</File:Comment>


Then if I do:
exiftool -file:comment="Curtis" exiftool.jpg
it just changes the second 'a comment' to 'Curtis' and the first one is unchanged.

But like I said of all my files I checked this is the only case where there are multiple instances in a group of the same tag that is writable.... (except in jpeg200.j2c, but that file type is not writable yet anyway)... so I will not worry about encountering this situation and just flag it with a warning if it is encountered.

Thanks for you help Phil!

Curtis

Phil Harvey

Hi Curtis,

It is possible for a JPEG file to have multiple comment segments.  When this happens, ExifTool will overwrite them all if you write a new Comment.

I have debated what to do about multiple comment segments, but currently they are extracted separately.  I thought about combining them into a single tag value, which makes sense in cases where it really is a single comment that was just too large for one JPEG segment, but it doesn't make sense to combine comments from different sources as with your example.  However, if I did combine them it would remove this particular ambiguity.  (Not that I am suggesting changing ExifTool's behaviour at this point.)

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

Curtis

Thank you Phil for the clarification on this.

Merry Christmas!