Adding tag with "/" to the filename

Started by carella, August 13, 2010, 02:06:50 PM

Previous topic - Next topic

carella

Hi
I have found in the FAQ how to create my own tags.
I created the following .Exiftool_config file

%Image::ExifTool::UserDefined = (
   'Image::ExifTool::Composite' => {
       MyShutterSpeedValue => {
           Require => 'ShutterSpeedValue',
           ValueConv => '$val =~ tr/\//-/; $val',
       },
    MyLensModel => {
           Require => 'LensModel',
           ValueConv => '$val =~ tr/\// /; $val',
       },
   },
);


The purpose of both tags is to suppress "/"
The MyLensModel works well
The MyShutterSpeedValue returns 0.00390625 ! (the ShutterSpeedValue returns 1/250)

I think that it's because this value is numerical and not string

How could I get 1-250 ?

thank you in advance

Phil Harvey

Use $prt[0] instead of $val in your expression.  @prt is an array of converted values, while @val are the unconverted values (and $val is set to $val[0] for convenience, but this isn't done with $prt[0]).

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

carella

Thank you very much for your quick answer ! ..... and for your fantastic work !

Everything is ok

Bye

Phil .... ippe