ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Mac2 on May 22, 2014, 05:36:20 AM

Title: -listx emits duplicate tag names (with different case)
Post by: Mac2 on May 22, 2014, 05:36:20 AM
I don't know if this is a bug or intentional:

When I dump all tags known to ExifTool with a command line like:

exiftool -f -t -l -listx -use MWG

Some groups emit duplicate tags which differ only by the upper/lower case in the id. For example:

<table name='DjVu::Meta' g0='DjVu' g1='DjVu-Meta' g2='Image'>

contains

<tag id='author' name='Author' type='?' writable='false' g2='Author'>
<tag id='Author' name='Author' type='?' writable='false' g2='Author'>

or

DjVu::Meta\Title\Title\0 and DjVu::Meta\title\Title\0

There are similar duplicates for other groups as well, e.g.

Kodak::DcMD\CMbo\CameraByteOrder\0
and Kodak::DcMD\cMbo\CameraByteOrder\0
QuickTime::HintTrackInfo\tpaY\TotalBytesNoRTPHeaders\0 and QuickTime::HintTrackInfo\tpay\TotalBytesNoRTPHeaders\0


This causes some issues when my application caches tag names in a database and with the same data ending up in different buckets...

Title: Re: -listx emits duplicate tag names (with different case)
Post by: Phil Harvey on May 22, 2014, 08:13:06 AM
In general, tag ID's are case sensitive.  If the originating software isn't consistent with its tag ID's, then this may be reflected in the ExifTool tag information database.  There isn't anything I can do about this.

- Phil
Title: Re: -listx emits duplicate tag names (with different case)
Post by: Mac2 on May 22, 2014, 01:52:10 PM
Hi, Phil

I thought you 'make up' the names you use for tags in ExifTool and thus were in control about the exact spelling?
Title: Re: -listx emits duplicate tag names (with different case)
Post by: Phil Harvey on May 22, 2014, 02:00:05 PM
The tag names, yes.  The tag ID's, no.  Big difference.

The tag names are what you use in ExifTool commands.  The ID's are what is stored in the file.

- Phil
Title: Re: -listx emits duplicate tag names (with different case)
Post by: Mac2 on May 22, 2014, 02:23:05 PM
Ah, important info.

Currently I use group id, tag id, tag name and tag index as a unique key to address a specific tag. When the case of the id changes, my software detects that and "folds" the data stored for the old tag key into the new tag key and from then on uses the new key to match the installed ExifTool release.

I just wondered why the same key showed up (with different case) in one group, or why the case of the key (id) sometimes changes between ExifTool releases. When a new ExifTool version ships I update my database by importing the -listx output and thus noticed the differences.
Title: Re: -listx emits duplicate tag names (with different case)
Post by: Phil Harvey on May 22, 2014, 04:57:12 PM
You may sometimes find the case of a tag name changes between releases, but tag names are not case sensitive, so this shouldn't be a problem (if it is a problem for you, then it may be smart to make them case insensitive in your database too).  It should be very rare to have a tag ID change case (although certainly I may add a new tag ID with a different case if I discover that some application writes it this way).

- Phil
Title: Re: -listx emits duplicate tag names (with different case)
Post by: Mac2 on May 23, 2014, 03:25:40 AM
Thanks for the detailed info! I will consider this.