ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: carella on August 13, 2010, 02:06:50 PM

Title: Adding tag with "/" to the filename
Post by: carella on August 13, 2010, 02:06:50 PM
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
Title: Re: Adding tag with "/" to the filename
Post by: Phil Harvey on August 13, 2010, 02:15:45 PM
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
Title: Re: Adding tag with "/" to the filename
Post by: carella on August 13, 2010, 02:19:13 PM
Thank you very much for your quick answer ! ..... and for your fantastic work !

Everything is ok

Bye

Phil .... ippe