News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Saving existing path and filename before rename

Started by dmee, February 20, 2021, 06:49:54 AM

Previous topic - Next topic

dmee

I have a very disorganised file/folder structure for my photos that I'm trying to get into order.
Because some programs I used to edit some photos, removed metadata, the only reliable info I have is in the folder structure and filenames (sometimes, and not consistent).

So I'd like to preserve this in some way before moving files around, in case some end up in the "wrong" place

First off, what 2 bits of metadata can I safely overwrite to hold this data, and then retrieve within Explorer (Win10) and or Lightroom, to double check everything looks right?

What exif command do I then need to run to say

"save full path info to X"
"save existing filename and extension to Y"

then I can run

"Rename all my photos to  YYYY-MM-DD_HH:MM:SS Existing Filename"

So... any ideas on the 2 safe metadata options and the 3 bits of code I should run

Many thanks


StarGeek

Do you need them saved separately?  The easiest thing to do would be
exiftool "-PreservedFileName<FilePath" /path/to/files/

PreservedFileName would be the standard location to hold the filename, but there's no reason you can't hold the whole path there as well, as there really isn't a standard place for just the path.  You would have to re-purpose some other, preferably obscure, location to hold the data. 

If you want to hold them separately, I'd suggest one of the Creative Commons tags.  I've never seen them actually used in the wild, nor have I seen any software that can set these tags.  A command to do this would be along these lines
exiftool "-PreservedFileName<Filename" "-AttributionName<${FilePath;s(/[^/]+$)(/)}}" path/to/files/

If you're on Windows, you should take note that exiftool usings slashes / for the directory path, not backslashes \.  If you needed to extract the original paths and use them in some other program, you would need to account for that.
* 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).

dmee

I wanted them separate so I could keep the original filename later, but just need the path saving so I can then check which files didn't end up in the correct folder.

So I'm guessing "original file name" will already have the filename and this won't change if I rename the file? So I just need to stick the path somewhere obscure and then rename my files?

StarGeek

Quote from: dmee on February 21, 2021, 06:31:54 AM
So I'm guessing "original file name" will already have the filename and this won't change if I rename the file? So I just need to stick the path somewhere obscure and then rename my files?

It won't change if you rename with exiftool or on the desktop.  If you rename in Lightroom, it might get changed, I don't know. You would have to test it out.
* 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).