Image-ExifTool - Re: Batch write filename to iptc field ?

Posted on Tue Apr 8 21:50:12 2008 by arthurb in response to 7598 (See the whole thread of 37)
Re: Batch write filename to iptc field ?
Hello, writing the filename into an IPTC tag was exactly what I wanted to do, but I found this thread very confusing. In particular I found the discussion about shortcuts quite difficult to follow, but then again others may well find the use of the Command Line interface difficult. Because of all this, and because now that I can do what I want quite easily (I did pick some things up from this thread), I will put in here a description of what I do, in the hope that someone else might find it helps them. Certainly, setting the filename into the IPTC ObjectName is very, very useful in my opinion, and was, I am sure, the original purpose for that field. I am very unsure about Adobe's current usage however, but that is another topic. Here is the little mini-tutorial...

ExifTool must be used from within a Windows XP Command Window (aka as a 'Command Prompt'). To open one: Click on 'Start', click on 'All Programs', click on 'Accessories' and then click on 'Command Prompt'.

This will open with the 'current directory (folder)' active, which can be changed using the 'cd' command, but that is not necessary if you fully specify the folders as shown in the examples below (ie the directories to be used for the program and the target image file are explicitly defined).

Note that the first string in each command (in double quotes), which specifies the program to be used (ie ExifTool), will be dependent upon the folder structure on the PC being used, and thus where 'ExifTool' is stored on the disk.

PLEASE NOTE: In the Commands below the 'less than' character (ie Shift + ,) has been replaced by "+" (a plus sign) to try and get the forum software to accept my post.

=============================================================================================

1. This will update the IPTC tag 'ObjectName' with the filename, including its extension, of the image file specified at the end of the command (ie in this case #_1.jpg):

"C:\Program Files\ExifTool_GUI\ExifTool" "-IPTC:ObjectName+filename" C:\Photos\testa\#_1.jpg"

----------------------------------------------------------------------------

2. This will update the same tag as above in the same way, but will do it for all .jpg files in the target directory given as the last string (in double quotes) in the command (ie "C:\Photos\testa").

"C:\Program Files\ExifTool_GUI\ExifTool" "-IPTC:ObjectName+filename" -ext .jpg "C:\Photos\testa"

=================================================================================

PLEASE NOTE AGAIN: Replace + in commands above with 'less than' (Shift + ,) END OF NOTE.

When ExifTool finishes, it will tell you if it has updated the file, or, if you have specified a complete directory, it will say it has scanned it and how many files it has updated. I believe you can tell ExifTool to scan sub-directories (which would involve a recursive execution of its code) by specifying the -r tag, but I have not used this and I do not therefore know how to use it. It is documented though.

I have to say that ExifTool, especially when used with ExifTool_GUI, is an incredibly useful, and for me essential, tool when dealing with image metadata. Thank you Phil, excellent work.

I thought I would do something helpful, and simple of course, here, but the forum software is so awful that I wish I hadn't bothered! Why is there no formatting, and why can't you use all of the keyboard characters (this is a real pain when describing ExifTool Commands) - I have no problems with any other forums, and I use lots of them - only this one is bad - why?

Direct Responses: 7623 | Write a response