Rename photo keeping original order

Started by metadata, February 12, 2019, 01:15:16 PM

Previous topic - Next topic

metadata

Hi,

I'd like to rename my photos and give them a specific name, followed by a number starting with e.g. 001 and counting up.

I tried exiftool -V '-testname<Jobname%-.3nc.%le' . but this yields:
QuoteSetting new values from P1050799.JPG
Warning = Invalid tag name 'Jobname%-.3nc.%le'
Nothing changed in ./P1050799.JPG
I guess this is because I don't specifiy a tag in the testname/filename option. The Thing is: I don't need one.

I tried then exiftool -V '-testname<${DateTimeOriginal}-Jobname%-.3nc.%le' -d "%Y%m" .
This results in another problem: Exiftool renames the photos randomly, so the original order is destroyed.

So, I'm looking for a way to rename the photos by giving them a specific (job)name and a sequential number while keeping the order the photos were taken. I could use ShutterCount to keep the order but how can I start with 001 and count up then?

Edit: I can't use ShutterCount because some photos were taken using the electronic shutter. My camera doesn't save a ShutterCount value then. So, is it possible to sort the photos using DateTimeOriginal but renaming them using only a name and a number?

Regards

StarGeek

Quote from: metadata on February 12, 2019, 01:15:16 PM
I tried exiftool -V '-testname<Jobname%-.3nc.%le' . but this yields:
QuoteSetting new values from P1050799.JPG
Warning = Invalid tag name 'Jobname%-.3nc.%le'
Nothing changed in ./P1050799.JPG

This is Common Mistake #5c, though in reverse.  You want to use an equal sign to set a static value.  The lesser/greater than signs are used to copy tags.  So try
'-testname=Jobname%-.3nc.%le'

QuoteThis results in another problem: Exiftool renames the photos randomly, so the original order is destroyed.

If this still happens, you can use the -fileOrder option to make sure it's sorted correctly.  For example, -fileOrder Filename.  This is something that I actually have to do at times because I use StableBit DrivePool and the order that the files are returned to exiftool varies depending upon the actually location of the files.
* 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).