Custom IPTC Record

Started by andreas.zehender, November 26, 2020, 10:42:31 AM

Previous topic - Next topic

andreas.zehender

Hi,

is it possible to specify custom IPTC records via configuration? What's working perfectly is adding custom tags to the IPTC ApplicationRecord 2:xxx, but how can I add an unsupported record? I get Warning = Unrecognized IPTC record 247 (ignored)

I'd like to extend Image::ExifTool::IPTC:Main like this: (from IPTC.pm)

%Image::ExifTool::IPTC::Main = (
   [...]
    240 => {
        Name => 'IPTCFotoStation',
        SubDirectory => {
            TagTable => 'Image::ExifTool::IPTC::FotoStation',
        },
    },
247 => {
        Name => 'IPTCCustomRecord247',
        SubDirectory => {
            TagTable => 'Image::ExifTool::IPTC::IPTCCustomRecord247',
        },
    },

Is this possible via Image::ExifTool::UserDefined?

Best,
Andreas

Phil Harvey

Hi Andreas,

See the example config file for an example.

- 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 ($).

andreas.zehender

Thanks, I know this file.

There is an example how to add an IPTC Tag, but not a whole IPTC Record.

I'd like to add IPTC field 247:200 as custom field.

Phil Harvey

Sorry.  I understand now.

This is basically the same as the example for adding a new XMP namespace.  The only trick is the necessary entries in the new table to allow tags to be written.  Here is an example config file to do this:

%Image::ExifTool::UserDefined::IPTCCustomRecord247 = (
    GROUPS => { 0 => 'IPTC', 1 => 'IPTC', 2 => 'Other' },
    WRITE_PROC => \&Image::ExifTool::IPTC::WriteIPTC,
    CHECK_PROC => \&Image::ExifTool::IPTC::CheckIPTC,
    WRITABLE => 1,
    100 => {
        Name => 'MyCustomTag',
        Format => 'string[0,256]',
    },
);

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::IPTC::Main' => {
        247 => {
            Name => 'IPTCCustomRecord247',
            SubDirectory => { TagTable => 'Image::ExifTool::UserDefined::IPTCCustomRecord247' },
        },
    },
);

1; #end


- 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 ($).

andreas.zehender

THANKS, that worked.
Best, Andreas