ExifTool Forum

ExifTool => Newbies => Topic started by: Tr on December 13, 2013, 05:00:50 PM

Title: Tag names with period ('.')
Post by: Tr on December 13, 2013, 05:00:50 PM
Hello:

I have image files with tag names containing a period ('.')

When I extract them using exiftool into a .csv and the '.' is removed:

XMP-avm:Spatial.Quality  ===> XMP-avm:SpatialQuality

When I run exif to write the .csv tags back into the image, a new tag (without the '.') is created, leaving the original one unchanged.  If I insert a period ('.') back into the tag name in the .csv, exiftool states it is an illegal tag name.

Reading other posts in this forum, the response usually states that periods ('.') are illegal for tag names in EXIF.  However the XMP standard is based on XML and XML does allow period in tag names ('.'). 

So I'm fairly confused and could use some help. 

References:
XMP Standard: http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cs6/XMPSpecificationPart1.pdf
XML Tag Names with a period ('.'): http://www.java2s.com/Tutorial/XML/0020__Introduction/XMLNamingConventions.htm
AVM Tag Standard: http://virtualastronomy.org/AVM_12_ref_table_rlh02_print2.pdf

Thanks so much,
Tr
Title: Re: Tag names with period ('.')
Post by: Phil Harvey on December 13, 2013, 06:55:20 PM
You tell me that a period is legal in an XMP property name, but it is not legal in an ExifTool tag name.  In the config file where you define this tag, you must specify a legal tag "Name" in the tag properties, something like this:

Code: [Select]
    'Spatial.Quality' => { Name => 'SpatialQuality' },
I know that you must have a config file containing this user-defined tag because you mentioned that you can write it (and it isn't one of the pre-defined XMP tags).

- Phil
Title: Re: Tag names with period ('.')
Post by: Phil Harvey on December 13, 2013, 07:22:16 PM
I tried this out, and could duplicate your problem with a user-defined tag.

It makes sense for me to add some protection against ExifTool automatically generating an illegal user-defined tag Name like this.  I'll add this in version 9.45.  But as I said, the solution for now is to specify a legal "Name".

- Phil
Title: Re: Tag names with period ('.')
Post by: Tr on December 16, 2013, 01:56:03 PM
Hi Phil:

Here is the Exiftool_config I am using:  https://github.com/clr/astronomy_visualization_metadata_exiftool_profile/blob/master/.ExifTool_config

Where do I insert the this line ?

    'Spatial.Quality' => { Name => 'SpatialQuality' },

I have attempted many times, but can't get the 'Spatial.Quality' Tag to update in the Image. :-(

Sorry, I am not a Perl guy :-(

Tr
Title: Re: Tag names with period ('.')
Post by: Phil Harvey on December 16, 2013, 02:04:32 PM
Hmmm.  There are a number of other tags with "." in that config file.  If you aren't in a hurry, you could just wait for ExifTool 9.45.  But to get this working now, you just have to add the Name definition to all necessary tags. For example, change

    'Spatial.Quality' => { },

to

    'Spatial.Quality' => { Name => 'SpatialQuality' },

in your config file.

- Phil
Title: Re: Tag names with period ('.')
Post by: Tr on December 16, 2013, 03:55:44 PM
Bingo !!!  Thanks Phil.

I will use this technique and modify the ExifTool_config for each of these custom tags.

I assume this is how do I set 2 properties on a Tag in Perl:

'Subject.Category' => { List => 'Bag' },

'Subject.Category' => { Name => 'SubjectCategory', List => 'Bag' },

Thanks again!

ExifT :) :) L Rocks !!!
Tr
Title: Re: Tag names with period ('.')
Post by: Phil Harvey on December 16, 2013, 06:54:49 PM
I assume this is how do I set 2 properties on a Tag in Perl:

'Subject.Category' => { Name => 'SubjectCategory', List => 'Bag' },

Correct.   Pretty good for not a Perl guy... ;)

- Phil