Using custom Namespaces

Started by ULSWK, November 25, 2024, 03:51:46 AM

Previous topic - Next topic

ULSWK

Hi,
I defined a custom namespace below XMP Namespace.
e.g. XMP:ABC
Writing Tags to this Namespace is easily done with a tag like this: -ABC:TypeCode=

When reading the written file afterwards, I get the tag like this: "XMP:TypeCode".
Is there a command line tag to change this to
"XMP:ABC:TypeCode" or "ABC:TypeCode"?



Phil Harvey

If you can write the tag with ABC:TypeCode then you will get ABC back as the family 1 group name (ie. with the -G1 option).

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

ULSWK

#2
Hi Phil,

thank's for your replay.
This is not the case, so maybe I'm doing something wrong.

This is my Configfile. Is there maybe any reason in here?

%Image::ExifTool::UserDefined::ABC = (
    GROUPS        => { 0 => 'XMP', 1 => 'ABC'},
    NAMESPACE    => { 'ABC' => 'http://mydomain/ABC' },
    OriginalFilename => { Writable => 'string' },
    Make => { Writable => 'string' },
    Model => { Writable => 'string' },
    TypeCode => { Writable => 'string' },
    DateTimeOriginal => { Writable => 'string' },
    DateInFilename => { Writable => 'string' },
    FileNumber => { Writable => 'string' },
    ExtBKT => { Writable => 'string' },
    ExtC => { Writable => 'string' },
    ExtPictureMode => { Writable => 'string' },
    MegaPixel => { Writable => 'string' },
    ExtFromFilename => { Writable => 'string' }
);

# 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' => {
        ABC => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::ABC',
            },
        },
    },
);

1;  #end

Phil Harvey

Right.  The family 1 group name must be "XMP-ABC" in your GROUPS definition.  So you will read/write the tag as XMP-ABC:TypeCode

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

StarGeek

Example using your config file. The config file is necessary for writing, but is not needed to read the data because it is in the XMP group
C:\>exiftool -config temp.txt -P -overwrite_original -ExtPictureMode="ExtPictureMode tag" -ExtC="ExtC tag" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -xmp:all y:\!temp\Test4.jpg
[XMP-x]         XMPToolkit                      : Image::ExifTool 13.03
[XMP-ABC]       ExtC                            : ExtC tag
[XMP-ABC]       ExtPictureMode                  : ExtPictureMode tag

"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