Modifying the config file.

Started by vegasidol, October 11, 2010, 08:47:11 PM

Previous topic - Next topic

vegasidol

I am modifying the Exiftool config file to add custom XMP fields. I have used the Exiftool sample config file (https://exiftool.org/config.html) to successfully add single line string data and mulitple choice data, but I am having trouble adding mulitple-line fields, date fields and integer fields. This is what I have so far.

%Image::ExifTool::UserDefined::TestData = (
    GROUPS        => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
    NAMESPACE     => { 'TEST' => 'http://my.custom.namespace/' },
    WRITABLE      => 'string',
    # replace "NewXMPxxxTag1" with your own tag name (ie. "MyTag")
    Cubicle_ID => { },
    Test_Manufacturer => { },
    Test_Make => { },
    AssetName => { },
    Test_Description => { },
    Silhouette => { },
    Identifier => { },
    Test_Model => { },
   
    Lighting => { List => 'Bag' },

What do I need to do to get the multi-line, data and integer fields readable?

FYI, I´m using Exiftool in conjuntion with ResourceSpace.

Also, I have replace my company name above with ¨Test¨.

Thank you for your help,

Vira

Phil Harvey

Hi Vira,

QuoteWhat do I need to do to get the multi-line, data and integer fields readable?

Any string may be multi-line, the only trick is getting the newline character into the string.  See FAQ number 21 for help with this.

I don't know what you mean by a data field.  XMP does not support binary data.  This may not be what you want, but you can encode binary data in Base64:


    MyTag => {
        ValueConv => 'Image::ExifTool::XMP::DecodeBase64($val)',
        ValueConvInv => 'Image::ExifTool::XMP::EncodeBase64($val)',
    },


See the XMP tag name documentation for a description of the available Writable formats.  For integer format, use integer.

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

vegasidol

I confused you with a typo. I meant 'Date field' not 'Data'.

You'll have to excuse me for not really understanding your answer well. I'm really just a graphic/web designer that knows HTML and CSS...and don't have too much other coding experience. I'm doing my best to wade through this to use ResourceSpace with our own custom metadata, and I think I've come pretty far on my own, but this last bit is confusing to me.

I don't understand your first link to FAQ number 21, and how it relates to modifying the config file for multiline data.

Also, where/how to I change the integer format?

Could you give me some examples to put in the config file?



Here are some screenshots to show you where I'm at, if they are helpful.

Bridge with a Generic Panel using single line, multi-line, dropdown, date and integer fields.


ResourceSpace after ingest with no data for the multi-line, date and integer fields imported with the config file in the backgroun.


Phil Harvey

It sounds like you've got most of this figured out and are just stuck on a few minor details.

Quote from: vegasidol on October 12, 2010, 01:56:47 PM
I don't understand your first link to FAQ number 21, and how it relates to modifying the config file for multiline data.

FAQ 21 doesn't relate to the config file, but the config file doesn't need to be modified for multiline data, so I just assumed your problem was elsewhere.  You may write a value containing newline characters to any string-type XMP tag.  ("string" is the default tag format for XMP unless otherwise specified)

QuoteAlso, where/how to I change the integer format?

Set Writable => 'integer', in the tag information.

QuoteCould you give me some examples to put in the config file?

See the Image::ExifTool::XMP.pm source code for lots and lots of examples.

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

Phil Harvey

I didn't answer your 'date' question.  For most date/time tags I add the following elements to the tag definition:

    Writable => 'date',
    Shift => 'Time',
    PrintConv => '$self->ConvertDateTime($val)',
    PrintConvInv => '$self->InverseDateTime($val,undef,1)',


This might not be easily apparent in the source code since I use a %dateTimeInfo hash to make adding these easier since it is so common.

See lib/Image/ExifTool/README for a complete description of the meaning of all these elements.

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