I want to put the filename without the extension in the cell, eg ImageDescription.
File Name: "sample.jpg"
An ideal data entered ImageDescription "sample"
I tried:
-ImageDescription<$filename
-Exif:DocumentName<$filename
but that is because he is not satisfied with .jpg
I tried with: -w% 6f
.. but do not know where to enter.
Thank you in advance for your help.
Thomas
Hi Thomas,
You need to create a user-defined tag to do this. See the "BaseName" example in the sample config file (https://exiftool.org/config.html) for how to do this.
- Phil
Thx Phil.
I'm not an expert so I need some time to understand the proposed solutions.
Thomas
With this config file:
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
GO => {
Require => {
0 => 'FileName',
},
ValueConv => 'my $name=$val[0]; $name=~s/\..*?$//; $name',
},
},
);
1; # end
and this command:
-ImageDescription<GO
How to define that the name was truncated to, eg 6 characters? (no matter how long it will last)
The ValueConv you have there removes the extension from the file name. There are various ways to truncate to 6 characters. Here is one:
ValueConv => '$val=~/(.{1,6})/; $1',
here is another:
ValueConv => 'length($val) > 6 ? substr($val,0,6) : $val',
- Phil
Rock'n'Roll. Thanks for your advice.
/T.