Original file name to Exif / IPTC?

Started by eric, August 21, 2010, 12:27:34 PM

Previous topic - Next topic

eric

I want to achieve the same like another newbie some months ago:
https://exiftool.org/forum/index.php/topic,2643.0.html

While this guy was in luck due to using Photoshop I'm not. So my question is how to write the original or current file name into a field like Exif's UserComment (or something similar, IPTC would be ok, as well)?

Sorry, in case this question has been answered before but I havn't found the solution so far.

Eric

Phil Harvey

Hi Eric,

The original file name must exist somewhere to be able to do this.  If you haven't renamed the file, then the "FileName" tag is what you want.  Otherwise, use exiftool -a -s FILE to see if it is hiding anywhere else.  If you can find it, then a command like this will do what you want:

exiftool "-usercomment<filename" 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 ($).

eric

Thank you Phil, for your quick response!

exiftool "-usercomment<filename" FILE is exactly what I was looking for.

Maybe one more beginner's question: How to perform that for a directory as a batch? There is no need to create different file names because a renaming can be done after the original file name has been written to the usercomment field. Can a batch be started from the GUI as well? (using Exiftool direct)

Thanks again, Eric

Phil Harvey

Doing this as a batch to all files in a directory is as simple as specifying the directory name instead of a file name on the command line.

I'm not sure if this can be done in the GUI.  If you post this question to the ExifTool GUI section of the forum then Bogdan may be able to help you.

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

eric

> I'm not sure if this can be done in the GUI. 

Looks like an easy one - I think one just has to select the files and then run the command.
Eric