Page 1 of 1

Auto embed filename into JPEG image metadata?

Posted: Thu Sep 09, 2021 6:51 pm
by foobar123
Hi, is there a way to auto-embed the image name into the jpeg metadata?

Clients often want delivered images re-named according to their standard. In order to quickly find the original images in my system, it would be helpful to be able to search metadata for an original filename regardless of what the image name was eventually changed to.

Bonus if this can be done at any time such as after other keywords are already set (maintain current keywords, just add the new one).

Thanks

Re: Auto embed filename into JPEG image metadata?

Posted: Thu Sep 09, 2021 9:30 pm
by XnTriq
Requested but not yet implemented:
michel038 wrote: Fri Sep 07, 2018 1:41 pmI found exiftool doc :

use this parameter :
-IPTC:Headline<${FileName;s/\.[^.]*$//} -overwrite_original -k -r
https://www.igoroseledko.com/renaming-files-with-exiftool/ wrote:It should be noted, though, that adding a tag to a file requires rewriting the entire file, so it adds quite a bit of time to the renaming process. Feel free to drop this step if the original filename is not something you care to remember. And, by the way, if you want to see the available tags in a file, use this command: exiftool -a -G1 -s <FILENAME>

Code: Select all

# Add a tag to the file with that file's filename
exiftool -P -overwrite_original_in_place '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' "${file_name}"

# Same as above but for all files in the current folder
exiftool -P -overwrite_original_in_place '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' .

# Same as above but for all file in the current folder and all subfolders
exiftool -P -overwrite_original_in_place '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' -r .
ExifTool Forum:

Re: Auto embed filename into JPEG image metadata?

Posted: Mon Sep 13, 2021 3:20 pm
by michel038
Since XnViewMp gives a "Tranfer metadata" feature, it's now easy ...

- Select Jpeg's
- Tools, Metadata, Transfer
- +Add, IPTC, Headline (or choose another field like Caption or Credits) as Target field
- Use the drop down menu to choose "Filename" or "Filename without extension" as source.
- Ok

Re: Auto embed filename into JPEG image metadata?

Posted: Mon Sep 13, 2021 3:30 pm
by XnTriq
michel038 wrote: Mon Sep 13, 2021 3:20 pmSince XnViewMp gives a "Tranfer metadata" feature, it's now easy ...
I stand corrected. Thanks for clarifying, michel038 (-:

Re: Auto embed filename into JPEG image metadata?

Posted: Tue Sep 14, 2021 2:20 pm
by foobar123
This will get me started.

Looks like I have to run the transfer metadata process to capture filename, then add custom keywords, etc.