New custom XMP-field in config-file

Started by tosz, July 30, 2019, 06:35:10 PM

Previous topic - Next topic

tosz

Hello,
I want to write a short string into a custom xmp-field (weather data) and can't get this to work. I guess I miss a comma or something. My config-file so far (ToszID has nothing to do with it and works perfectly):

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        ToszID => {
            Require => {
                0 => 'FileName',
            },
            ValueConv => '$val =~ /\((\d+)\)/ ? $1 : undef',
        }
},
'Image::ExifTool::XMP::xmp' => {
        weather =>
    }
);


But -xmp-xmp:weather="cloudy" does nothing.

Could the string contain any chars? I'd like to write JSON-data and it could look like:
{"temperature":24.5, "wind":7}

Thanks in advance for any comments,
Tosz.

StarGeek

Creating new xmp tags isn't my strong suit, but I think I have this working for you
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
ToszID => {
Require => {
0 => 'FileName',
},
ValueConv => '$val =~ /\((\d+)\)/ ? $1 : undef',
},
},
'Image::ExifTool::XMP::xmp' => {
weather => { },
},
);



Output
C:\>exiftool -config test3.config -weather=cloudy y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s  -weather y:\!temp\Test4.jpg
---- XMP-xmp ----
Weather                         : cloudy

"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