Failed to define an own user defined Tag

Started by ULSWK, March 08, 2024, 07:31:06 AM

Previous topic - Next topic

ULSWK

Hi all,
I'm struggeling when trying to define an own user defined tag.
I am trying to write the tag USP:OriginalFilename to my Fuji-RAW-File "TESTFILE.RAF"
Please advice what's wrong with the syntax.

My Configfile is named "EXIFTOOL_CFGFILE" (no file extension) and has the following content:
%Image::ExifTool::UserDefined = (
        'Image::ExifTool::Exif::Main' => {
            0xd000 => {
                Name => 'OriginalFilename',
                Writable => 'string',
                WriteGroup => 'USP',
            },
            # add more user-defined EXIF tags here...
        },
        # new XMP namespaces (eg. xxx) must be added to the Main XMP table:
      'Image::ExifTool::XMP::Main' => {
          # namespace definition for examples 8 to 11
          USP => { # <-- must be the same as the NAMESPACE prefix
              SubDirectory => {
                  TagTable => 'Image::ExifTool::UserDefined::USP',
              },
          },
      },
);
 

The Exiftool is called like this:
c:\exiftool\exiftool.exe -config D:\#BV\EXIFTOOL_CFGFILE -USP:OriginalFilename="First Try" H:\_EXIFTest\TESTFILE.RAF

StarGeek

In the top part, you're defining an EXIF tag, but the bottom part is defining a XMP group

This works for me, though you might need to tweak it a bit.
%Image::ExifTool::UserDefined = (
# new XMP namespaces (eg. xxx) must be added to the Main XMP table:
    'Image::ExifTool::XMP::Main' => {
        # namespace definition for examples 8 to 11
        USP => { # <-- must be the same as the NAMESPACE prefix
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::USP',
                # (see the definition of this table below)
            },
        },
        # add more user-defined XMP namespaces here...
    },
);

%Image::ExifTool::UserDefined::USP = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-USP', 2 => 'Image' },
    NAMESPACE => { 'USP' => 'http://ns.myname.com/USP/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")
    OriginalFilename => {  },
);
1#

I'm wondering why you feel the need to create your own tag here, though, as there already is a standard place for the original file name with the XMP-xmpMM:PreservedFileName tag.  There's even another tag with the same name used by Getty Images, XMP-getty:OriginalFileName.

* 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).