I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-03-04 07:00:34-08 by nohurti
exiftool newbie
I've spent hours but I still haven't figured out how I can use exiftool to accomplish my goal. I apprechiate any help. I want to recurse through a messy directory structure and for each .jpg file, write the full path and filename to that file's IPTC Caption tag. I can at least assign any fixed text to all the files in this way but not the path and file information. I see there are many options to do lots of file moving and file renaming but this is different, all the filenames and locations remain the same, I just want to stuff the files with their own path and filename. Thank you.
Direct Responses: 10108 | Write a response
Posted on 2009-03-04 09:10:27-08 by bogdan in response to 10107
Re: exiftool newbie
Hi,

I hope, I understand what you're trying to accomplish... so try:

exiftool "-iptc:Caption-Abstract<$directory/$filename" c:\xx
-this will write into each file (inside c:\xx directory) it's path and filename.

After you're sure this is what you want, you can use -r option (recursive):
exiftool "-iptc:Caption-Abstract<$directory/$filename" -r c:\xx
-which will do the same for all underlying directories (that is, subdirectories of c:\xx).

To prevent making of (_original) backups, use -Overwrite_original option.

Above is for Windows usage -if you're not on Windows, then you should use single quote instead.

Notice: On Windows, directories are (visualy) separated by backslash... but when exiftool executes above command, normal (not back) slash is written. Not a big deal, though.

Greetings,
Bogdan
Direct Responses: 10109 | Write a response
Posted on 2009-03-04 13:13:16-08 by nohurti in response to 10108
Re: exiftool newbie
Bogdan Wow! that is it! Thank you so much, and such a complete answer. It is very good as it is now, but, if I dare point out one imperfection: the diectory path shows up, even for all the deeply nested directories but not the full path (from the drive letter and root). I don't "need" that but now I'm curious that there just happens to be something in exiftool to allow for that. I did a search but couldn't find anything like "path". Thanks to you, I can continue with my task.
Direct Responses: 10113 | Write a response
Posted on 2009-03-04 15:59:03-08 by exiftool in response to 10109
Re: exiftool newbie
I'll have to run some tests to see how this behaves in Windows, but the intent is for the Directory to contain the full directory name starting with what was specified on the command line. The only thing I'm worried about is the drive letter. I'm using the Perl File::Basename::dirname() routine to separate the directory name here, and I'll have to check to see if that includes the drive letter.

- Phil
Direct Responses: 10116 | Write a response
Posted on 2009-03-04 23:02:47-08 by exiftool in response to 10113
Re: exiftool newbie
I checked the File::Basename documentation, and it convinced me that the drive letter should be included. I fired up my Windows box and verified that it indeed is.

So if you aren't getting a full path specification, it is because you aren't giving one. ExifTool will report the path beginning at the base directory as entered on the command line. So if you want a full directory name, be sure to specify it that way.

- Phil
Direct Responses: Write a response