Write Filename into Metadata

Started by StefanBogner, March 31, 2023, 10:11:39 AM

Previous topic - Next topic

StefanBogner

Dear all, this is my first topic in this forum, so hello to you reading this post. I am native german speaking, so maybe my english may not be correct 100 % of the time, please bear with me.

I installed the tool and can run it from the commandline (?) tool.

What I need the exiftool to do:
1) in a first step I have a folder with many images with a "correct" filename. I need to get the filename into the metadata of each image, because I will have them all linked into an indesign-file that crops the images. From this file I will write a PDF and extract the correctly cropped images. Unfortunately these images have lost the original file names. In the second step...

2) ... I hope that the metadata is still in the image files. That would hopefully then allow me to write the filename from 1) back into the filename of the cropped images.

A bit more descriptive maybe this way:
"peter_miller.jpg" > write name into file > link jpg into indesign and crop it > write pdf > extract image > its filename is now "image1.jpg" or similiar > write name-information from metadata into filename > cropped image is now "peter_miller.jpg" again

Do you understand my task from my description above? How do I do it?

Thank you a lot for reading this far and maybe even for your help or solution,
Stefan

Phil Harvey

Hi Stefan,

1. exiftool "-originalfilename<filename" FILE

Quote from: StefanBogner on March 31, 2023, 10:11:39 AM2) ... I hope that the metadata is still in the image files.

Yes, because this command won't work otherwise:

2. exiftool "-filename<originalfilename" FILE

You can specify one or more directory and/or file names for FILE to process multiple files at once.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StefanBogner

Dear Phil,

thank you a lot for your swift reply! I will try this soon and let you know, if I managed to get it done.

Regarding your quote of my question: I meant it a bit different. My process is to export a PDF from Indesign and afterwards extract the images from the pdf. So my hope goes towards the PDF extraction process, I hope that this one keeps the originalfilename-data and doesn't have anything to do with exiftool. This wasn't exactly part of the question, it was a description of my process.

Thanks once again! Great tool and great site!
Stefan

StarGeek

Quote from: StefanBogner on March 31, 2023, 11:52:55 AMMy process is to export a PDF from Indesign and afterwards extract the images from the pdf. So my hope goes towards the PDF extraction process, I hope that this one keeps the originalfilename-data

This is something you'll have to test.  Exiftool doesn't have any control over whether Indesign will strip the metadata or not.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Hi Stefan,

Yes, I understood.  But often metadata is lost in file manipulations by other software.  So good luck!

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).