ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:12 AM

Title: Question about tag name case
Post by: Archive on May 12, 2010, 08:54:12 AM
[Originally posted by louie51 on 2007-12-03 17:09:37-08]

Hi, I am a little confused how exiftool can accurately work with the xml data where the tags are case sensitive. I downloaded the application hoping it would help me cleanup a situation where I incorrectly applied a XMP tag that had the wrong case. I am using ImageIngester Pro to import and rename my images. I used it to save the original image file name in the xmpMM PreservedFilename data field. What I got wrong is that this XMP tag is supposed to be a capital N on name. The data is stored in the image files but is not recognized by the Bridge CS3 metadata panel.

Because XML is case sensitive I was expecting that exiftool would know that -PreservedFilename is different from -PreservedFileName and I could copy from one to the other and then delete the incorrect tag which doesn't seem possible as exiftool is not sensitive to case here.

I was also interested to discover that was able to extract either form of internal XMP tag regardless of the case in the image XMP data. So  I get the following:

exiftool -s -preservedfilename newfile.dng

PreservedFilename: myoldfile.dng

or

exiftool -s -preservedfilename othernewfile.dng

PreservedFileName: myotheroldfile.dng

I understand the notion described on the Tag Names documentation that tag names are handles use to lookup the detail of a specific "Tag ID". Am I right in guessing that the the tag id then is the unique case sensitive XML tag? That would imply that using -preservedfilenam=theoldname would create a XMP tag id of PreservedFileName with the value of "theoldname".

Is this correct?

tks, louie
Title: Re: Question about tag name case
Post by: Archive on May 12, 2010, 08:54:12 AM
[Originally posted by exiftool on 2007-12-03 19:57:12-08]

Hi Louie,

Case problems are common in XMP (Windows Vista is a bad offender
for example).  For this reason, exiftool is tolerant about the case of XMP
tag ID's.  (I differentiate between the ID's stored in the file and the tag
names that ExifTool uses because they are not always the same.  Plus,
exiftool is not case sensitive for tag names.)

So you are right about your understanding of the tag ID.

However, using exiftool to fix the case turns out to be not as simple as
one might think because although exiftool will always create a new tag
with the correct case, it will preserve the incorrect case of an existing
tag if you are just editing the value.  So fixing the case of a tag needs
to be done in two steps.  First delete the tag, then create it again:

Code:
exiftool -o mynewfile.dng -preservedfilename= myoldfile.dng
 exiftool -tagsfromfile myoldfile.dng -preservedfilename -overwrite_original mynewfile.dng

After these commands, mynewfile.dng will have PreservedFileName with
the proper case.

- Phil
Title: Re: Question about tag name case
Post by: Archive on May 12, 2010, 08:54:12 AM
[Originally posted by louie51 on 2007-12-04 05:07:04-08]

Hi Phil,

Thanks that worked.

-louie