Assign New user defined NAmespace and fields to a file and/or a directory

Started by ExifStruggles, September 25, 2023, 04:19:43 PM

Previous topic - Next topic

ExifStruggles

I am trying to assign a user-defined namespace and fields/tags. I have tried several steps that have been in another forum list without success. The intent is to create these custom fields in images so I can populate them after some analysis and have the results in the metadata.

I have tried to execute this by creating a config file (t3.config) and refrence the config file

Code to execute: C:\Users\tgi>exiftool -config "C:\exiftool-12.32\.ExifTool_config" "C:\Users\tgi\Desktop\Testing\test.jpg"

Any guidance is appreciated.


Config File code:
%Image::ExifTool::UserDefined::ns_1 = (
    GROUPS        => { 0 => 'XMP', 1 => 'XMP-ns_1', 2 => 'Image' },
    NAMESPACE    => { 'ns_1' => 'http://mydomain/ns_1' },
    WRITABLE      => 'string',
    tag_one => { },
    tag_two => { },
    tag_three => { },
    pumpkinpie => { },
);

%Image::ExifTool::UserDefined::ns_2 = (
    GROUPS        => { 0 => 'XMP', 1 => 'XMP-ns_2', 2 => 'Image' },
    NAMESPACE    => { 'ns_2' => 'http://mydomain/ns_2' },
    WRITABLE      => 'string',
    abc_one => { },
    donuts => { },
    abc_two => { },
    spaceship => { },
    unknown => { },
);

# The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.
%Image::ExifTool::UserDefined = (
    # new XMP namespaces (ie. XXX) must be added to the Main XMP table:
    'Image::ExifTool::XMP::Main' => {
        ns_1 => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::ns_1',
            },
        },
        ns_2 => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::ns_2',
            },
        },
    },
);

1;  #end

StarGeek

You say the config file is "t3.config" but your -Config option is calling ".ExifTool_config"

Your config file works fine here
C:\>exiftool -config test.config -P -overwrite_original -tag_one="Tag One" -tag_two="Tag Two" -tag_three="Tag Three" -pumpkinpie="Ymmm" -abc_one="XYZ better" -donuts="Party Time" -abc_two="123" -spaceship=Rocinante -unknown="Truth is out there" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -XMP:all y:\!temp\Test4.jpg
[XMP-x]         XMPToolkit                      : Image::ExifTool 12.67
[XMP-ns_1]      Pumpkinpie                      : Ymmm
[XMP-ns_1]      Tag_one                         : Tag One
[XMP-ns_1]      Tag_three                       : Tag Three
[XMP-ns_1]      Tag_two                         : Tag Two
[XMP-ns_2]      Abc_one                         : XYZ better
[XMP-ns_2]      Abc_two                         : 123
[XMP-ns_2]      Donuts                          : Party Time
[XMP-ns_2]      Spaceship                       : Rocinante
[XMP-ns_2]      Unknown                         : Truth is out there

Note that you can place the config file in the same directory as exiftool and then you don't need to provide the full path, just the name.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype