how to use exposuretime with the renamefunction on windows?

Started by lui, August 24, 2012, 02:57:30 PM

Previous topic - Next topic

lui

Hello,

i try
exiftool "-filename<${CreateDate}_${imagesize}_${FNumber}_${CameraISO}_${ExposureTime}-%%c.%%e" -d "%%Y-%%m-%%d_%%H-%%M" %folder% *.jpg
in a batch-file. without the exposuretime it works great.

the problem is, that the exposuretime includes a slash "/" and that makes window confused (i think unix too).

best regards
lui


Phil Harvey

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

lui

Hi Phil,

sorry, i know absolut nothing about perl. and google is not my friend in this case.
i follow your hint and use this:

# remove invalid filename characters from the ExposureTime-tag
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyExposureTime => {
            Require => 'ExposureTime',
         ValueConv => q{
            $val =~ s/\//!/;
            return $val;
         },
        },
    },
);

but the result is i.e. "0.0015625" instead "1!640". i think the problem is that perl think it's an expression and evaluate it. how can i prevent this?

thx
lui

Phil Harvey

Hi Lui,

Close.  The problem is that "$val" is the computer-readable value, but you want the print-converted value.  Try this:

# remove invalid filename characters from the ExposureTime-tag
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyExposureTime => {
            Require => 'ExposureTime',
            ValueConv => q{
               my $exp = $prt[0];
               $exp =~ s/\//!/;
               return $exp;
            },
        },
    },
);


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

lui

Wow, it feels like a chat  :) And wow, works perfect now!

Thank you very much and best regards.
lui