ExifTool Forum

ExifTool => Newbies => Topic started by: marcb on July 12, 2014, 01:05:31 AM

Title: show directory/path in recursive listing
Post by: marcb on July 12, 2014, 01:05:31 AM
Hi,

I need a recursive listing of pics in a directory tree to import in excel including the full path of the pictures.

Using -t I get a listing that shows the subdirectories, but the data are not well ordered for easy import.

H:\Pictures\test>exiftool  -t -r -filename -createdate -iso -aperture -shutterspeed *

======== m107157.jpeg
File Name       m107157.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== m107158.jpeg
File Name       m107158.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== subdir/m107160.jpeg
File Name       m107160.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== subdir/m107161.jpeg
File Name       m107161.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50


Using -T the data are well ordered, but the output doesn't show path or subdirectories.

H:\Pictures\test>exiftool  -T -r -filename -createdate -iso -aperture -shutterspeed *

m107157.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107158.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107160.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107161.jpeg    2013:01:30 09:48:43     800     4.5     1/50


I've been unable to find a way to include the path or even the subdirectory names in the output. How do I do that?

tnx
marc
Title: Re: show directory/path in recursive listing
Post by: Hayo Baan on July 12, 2014, 03:42:59 AM
You get the path using -directory.

Hope this helps,
Hayo
Title: Re: show directory/path in recursive listing
Post by: marcb on July 12, 2014, 05:08:00 AM
tnx for taking the time to help out a newbie!
Title: Re: show directory/path in recursive listing
Post by: Hayo Baan on July 12, 2014, 07:06:22 AM
You're welcome :)
Title: Re: show directory/path in recursive listing
Post by: Hayo Baan on July 12, 2014, 09:19:42 AM
Oh, and if you want to go fancy, you can create your own composite tag for the full filename as well. Just put the following code in your .ExifTool_config file (or create one in your home directory if you don't yet have one.

%Image::ExifTool::UserDefined = (
  'Image::ExifTool::Composite' => {
    FullFileName => {
      Require => {
        0 => 'Directory',
        1 => 'FileName',
      },
      ValueConv =>
        'my $f = ($val[0] =~ s#^\./?##r); $f .= "/" if $f; $f .= $val[1]',
    },
  },
);


With that code you can now use -FullFileName if you want the full file spec, including directory  8)

Have fun,
Hayo