I would like to use multiple conditions, e.g.
if "$Model eq 'NIKON D200'" -> -"Nikon:CameraSerialNumber=6007814'"
if "$Model eq 'DSC-V3'" -> -"EXIF:CameraSerialNumber=7559435"
if <another condition> -> ....
In the command line it is not possible, because all conditions must be true to execute the meta data changes.
Is it possible to add multiple condition statements to the .ExifTool_config file?
How can this be done? (I am not so familiar with Perl and I did not find an example.)
Thank you very much in advance for your attention,
Manfred
Hi Manfred,
You can do this by separating the commands with the -execute option:
exiftool -if "$Model eq 'NIKON D200'" -Nikon:CameraSerialNumber=6007814 -execute -if "$Model eq 'DSC-V3'" -EXIF:CameraSerialNumber=7559435 -common_args DIR
The only downside is that the files are parsed for each command.
- Phil
Edit: Added missing "-" to -if
Hi Phil,
I tested multiple -if conditions separated by -execute options on the command line work as you suggest.
BUT I want to use many (> 20) if conditions - so the files are parsed more than 20 times. This takes too much time for (big) RAW files.
Is there another solution possible? (e.g. if conditions in .ExifTool_config file)
Best regards,
Manfred
Hi Manfred,
It is a bit more complicated, but this could be done with user-defined tags and a command like this
exiftool "-cameraserialnumber<myserialnumber" DIR
with a config file (https://exiftool.org/config.html) like this:
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
MySerialNumber => {
Require => 'Model',
ValueConv => q{
return 6007814 if $val eq 'NIKON D200';
return 7559435 if $val eq 'DSC-V3';
# ...
return undef;
},
},
},
);
1; # end
- Phil