Add XMP tag to each page of multipage tiff

Started by tex887, April 20, 2016, 07:30:08 PM

Previous topic - Next topic

tex887

I am trying to add a XMP tag to each page of a multi-page tiff.  I am however getting hung up on the syntax.  I understand that a configuration file will need to be created too but I just can't seem to get the syntax correct for it to write to all pages.

I am trying to add the XMP tag BandName to each one of the pages. I have four pages Red, Green, Blue, and NIR (i.e. IFD0,IFD1,IFD2,IFD3). The following is what my configuration file looks like.



%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        Camera => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::Camera',
            },
        },
    },
);


%Image::ExifTool::UserDefined::Camera = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Image' },
    NAMESPACE => { 'Camera' => 'http://test.com/1.0' },
    WRITABLE => 'string',
    BandName => {},
);



I have tried calling it both from perl and from command line but I get the same results.  Any help would be greatly appreciated.

Thanks,
Austin

Phil Harvey

Hi Austin,

The way I see it, you have 2 problems:

1. Adding metadata to individual pages of a multi-page document.

2. Creating a user-defined XMP tag.

For 1, I think you are out of luck since ExifTool only writes document-level metadata in files.

For 2, Your config file looks good to me.  This should work.

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

tex887

Hi Phil,

Thanks once again for your very quick response!  My overall goal is to simple mimic one of the two options. I pulled this from somewhat of a cryptic help document.

Quote
Key
Xmp.Camera.BandName

Value example
{"Red","NIR"}

Type
XmpSeq

Meaning
Name of each band (sequence).

Single page image: one name for each band of the image.
Multipage image: one band name per image page. (Note: this allows only one band per page, since sequence of sequence is not possible).

I assumed that adding an XMP tag to each page would be the simplest, however if that is not the case I can re-stack my data into a single page tiff with multiple bands.  If I go that route though then I need to structure it as a XmpSeq.  To do that do I simply need to add list = 'Seq' to my BandName tag in the configuration file?

Thanks for all your help,

Austin

Phil Harvey

Hi Austin,

Quote from: tex887 on April 21, 2016, 10:40:31 AM
To do that do I simply need to add list = 'Seq' to my BandName tag in the configuration file?

Yes.  "List" with a capital "L".

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