Getting file path information

Started by jeno, September 18, 2015, 12:27:51 AM

Previous topic - Next topic

jeno

Hi,

I am wondering if it is possible to retrieve file location information? I am thinking of a situation where I wanted to write this information into xmp (probably into pdf's "Directory" field) before send it off to customer. That way I would able to know where this file is originated when I review them a few weeks later.

Regards,
Jeno

Alan Clifford

exiftool -comment=`pwd -P`"/"`dirname ./temp2/dscn2404.jpg` ./temp2/dscn2404.jpg

gives

exiftool -comment temp2/dscn2404.jpg
Comment                         : /Users/alan/photographs/temp/./temp2


This is on a Mac so anything Unix I guess.

Later ...

hmmm, let's see if I can do that all in exiftool.

Phil Harvey

First, you would have to define the XMP-pdf Directory tag as a user-defined tag, but then the command would be:

exiftool "-xmp-pdf:directory<file:directory" -r DIR

See the sample config file for examples on how to create user-defined tags.

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

Alan Clifford

Phil, doesn't that just give the relative directory unless you specify the full path?

egremont:temp alan$ exiftool "-comment<file:directory" ./temp2/dscn2404.jpg
    1 image files updated


egremont:temp alan$ exiftool -comment temp2/dscn2404.jpg
Comment                         : ./temp2

Phil Harvey

Yes, you are correct.  You must specify the absolute directory if that's what you want in the Directory tag.

Or to get an absolute directory when you specify only a relative one, you could use the FilePath tag.

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