Folder names

Started by terrypin, March 18, 2013, 11:39:58 AM

Previous topic - Next topic

terrypin

Couple of questions about the way ExifTool and ExifToolGUI work with and display folder names please.

I have installed ExifToolGUI and Exiftool.exe is in C:\Windows as recommended.

I read that I could drag a file containing EXIF data onto the executable exiftool(-a -u -g1 -w txt).exe  and "...a TXT file will be silently written in the original folder, containing all EXIF/Comment data." I didn't see any recommendation as to where that renamed EXE should be located, so I have mine here rather than in the C:\Windows folder:
C:\Program Files\MiscTools\exiftool(-a -u -g1 -w txt).exe
Q1: Is that OK?

I found that I could instead drag my photos to a shortcut to it:
C:\Documents and Settings\Terry\Desktop\Useful Tools\ExifTool9230(-a -u -g1 -w txt).exe.lnk
That works fine and strikes me as a neater method than duplicating the EXE.

Q2: But why does it display the exported TXT with the seperators in folder names changed to forward slashes?

---- ExifTool ----
ExifTool Version Number         : 9.23
---- System ----
File Name                       : 20040820-110033.JPG
Directory                       : C:/Docs/My Pictures/PHOTOS/Walks UK/TP04/TP04-All/Tests

Q3: How can I get the folder name displayed in the TXT file exported by ExifTools GUI please (ideally in the correct format)? IOW, what entry do I make in the Workspace Manager please?

Q4: Is it possible to get a full filename with path instead, rather than two separate items?

Sorry if these are very basic, but this is day 1 on what seems to me as quite a steep learning curve and as I've said in an earlier post I'm struggling a bit!

--
Terry, East Grinstead, UK

Phil Harvey

Hi Terry,  I'll try to answer your questions:

Q1: Yes, but I recommend adding the options to the Target settings in a shortcut so you don't have to duplicate the .EXE as you mentioned

Q2: ExifTool in Windows understands both forward and backward slashes, but converts all to forward slashes for cross-platform compatibility.

Q3: I'm not sure how the GUI works.  If it changes the working directory before running the command then the value of the Directory tag in the output may be wrong.  Changing the forward slashes to backward slashes could be done with a user-defined tag, but this is a bit complicated.

Q4: Again, this may be accomplished with a user-defined tag, but this isn't really a beginner-type-thing-to-do.

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

terrypin

Thanks Phil, all understood.

I'll experiment further to get folder via the GUI export.

I suppose I could handle the slash problem in my text editor:



but I'd prefer to do it in ExifTool or the GUI if possible. I'm guessing it would use the feature that accesses Regex? I don't know the PERL version of that (TextPad's is different) but I'd be content to paste in an expression within an ExifTool command(?) by rote!

Thanks for your patience!

--
Terry, East Grinstead, UK

Phil Harvey

This config file should give you a "MyFileName" tag in the format that you want:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyFileName => {
            Require => {
                0 => 'Directory',
                1 => 'FileName',
            },
            ValueConv => q{
                my $val = $val[0] . '/' . $val[1];
                $val =~ tr{/}{\\\\};
                return $val;
            },
        },
    },
);
1;  #end


See the sample config file for instructions on activating this file.

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