ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: RobiWan on May 10, 2018, 06:58:17 PM

Title: TAG (XMP-onone) is not defined
Post by: RobiWan on May 10, 2018, 06:58:17 PM
Hi,

I try to modify xmp files if they have a spezial keyword with this command

exiftool -if "$Subject eq 'Vermerk, Defekt'" "-$xmp-onone:UserFlag+=3" _rr_3117.xmp -overwrite_original

but I receive: Warning: Tag '$XMP-onone:UserFlag' is not defined. And its not true, because

exiftool -a -s -G1 _rr_3117.xmp give me

[XMP-tiff]      Model                           : Canon EOS 5D Mark III
[XMP-tiff]      Orientation                     : Horizontal (normal)
[XMP-onone]     UserFlag                        : 2

Any Idea what I can do?

Robert

Title: Re: TAG (XMP-onone) is not defined
Post by: StarGeek on May 10, 2018, 09:52:26 PM
The tag not defined warning means that exiftool doesn't know the schema for how that tag is to be written.  It can read it and output the data easily enough due to the way XMP tags work, but without a definition on how to write the tag, it can't do so.

If you want to write that tag, you'll have to create a User-Defined Tag.  See the example config file (https://exiftool.org/config.html) for instructions on how to do so.
Title: Re: TAG (XMP-onone) is not defined
Post by: RobiWan on May 11, 2018, 07:03:46 AM
Thanks for the answer. I think I did not understand the description completely or wrongly.

I downloaded the sample.config and changed some lines


# new XMP namespaces (eg. xxx) must be added to the Main XMP table:
    'Image::ExifTool::XMP::Main' => {
        # namespace definition for examples 8 to 11
## xxx => { # <-- must be the same as the NAMESPACE prefix
        onone => { # <-- must be the same as the NAMESPACE prefix
            SubDirectory => {
                ## TagTable => 'Image::ExifTool::UserDefined::xxx',
TagTable => 'Image::ExifTool::UserDefined::onone',
                # (see the definition of this table below)
            },
        },




## %Image::ExifTool::UserDefined::xxx = (
%Image::ExifTool::UserDefined::onone = (
    ## GROUPS => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
    GROUPS => { 0 => 'XMP', 1 => 'XMP-onone', 2 => 'Image' },
    ## NAMESPACE => { 'xxx' => 'http://ns.myname.com/xxx/1.0/' },
    NAMESPACE => { 'onone' => 'http://www.ononesoftware.com/vcb/1.0/' },
    WRITABLE => 'string', # (default to string-type tags)
    # Example 8.  XMP-xxx:NewXMPxxxTag1 (an alternate-language tag)
    # - replace "NewXMPxxxTag1" with your own tag name (eg. "MyTag")
    ## NewXMPxxxTag1 => { Writable => 'lang-alt' },
    UserFlag => { Writable => 'lang-alt' },


nothing else, but it will not work :(

Title: Re: TAG (XMP-onone) is not defined
Post by: Phil Harvey on May 11, 2018, 07:20:56 AM
You config file looks OK to me.

What was the command you used and what was the config file named and where was it located?

See FAQ 11 (https://exiftool.org/faq.html#Q11) for some tips.

- Phil
Title: Re: TAG (XMP-onone) is not defined
Post by: RobiWan on May 11, 2018, 08:57:49 AM
Hi Phil,

exiftool -config onone.config -m -f -if "$Subject eq 'Vermerk, Defekt'" "-$XMP-onone:UserFlag+=3" _rr_3117.xmp -overwrite_original
Warning: Tag '$XMP-onone:UserFlag' is not defined


config file is saved in same directory as the XMP file
Title: Re: TAG (XMP-onone) is not defined
Post by: Phil Harvey on May 11, 2018, 09:26:44 AM
Ah.  That's the problem.

Try this:

exiftool -config onone.config -m -f -if "$Subject eq 'Vermerk, Defekt'" "-XMP-onone:UserFlag+=3" _rr_3117.xmp -overwrite_original

You shouldn't have a "$" before the tag name -- that is just used when interpolating tags within a -if condition, etc.

But note that you have used += on a non-list tag.  So in this case it will be an interger increment, and will only have an effect if UserFlag already exists and is an integer.

- Phil
Title: Re: TAG (XMP-onone) is not defined
Post by: RobiWan on May 11, 2018, 10:22:05 AM
Thank you Phil,

[EDIT]
All works perfect !!!
[/EDIT]

its work now but not I want

This is my command
exiftool -config onone.config -m -f -if "$Subject eq 'Vermerk, Defekt'" "-XMP-onone:UserFlag=3" _rr_3117.xmp -overwrite_original

This writes exiftool

<rdf:Description rdf:about=''
  xmlns:onone='http://www.ononesoftware.com/vcb/1.0/'>
  <onone:UserFlag>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>3</rdf:li>
   </rdf:Alt>
  </onone:UserFlag>
</rdf:Description>


But I need this
<onone:UserFlag>3</onone:UserFlag>