TAG (XMP-onone) is not defined

Started by RobiWan, May 10, 2018, 06:58:17 PM

Previous topic - Next topic

RobiWan

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


StarGeek

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 for instructions on how to do so.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

RobiWan

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 :(


Phil Harvey

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 for some tips.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

RobiWan

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

RobiWan

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>