Author Topic: Revert camera filename back to original filenames prior to import  (Read 799 times)

Offline catchapman

  • Newcomer
  • *
  • Posts: 1
    • View Profile
Hi,

I would like to restructure my library and revert my filenames back to the original filenames prior to importing onto computer. I always amend the filenames when importing and now cannot figure out a way to basically reset them back to their 'raw' default filenames.

I have tried various things but both Adobe Bridge and Lightroom just have an original filename option but this is AFTER import which does not solve my problem. Can Photo Mechanic help me?

Regards
Catherine

Offline Robert Edwards Media

  • Newcomer
  • *
  • Posts: 14
    • View Profile
    • Robert Edwards Media
Re: Revert camera filename back to original filenames prior to import
« Reply #1 on: November 24, 2024, 08:36:45 PM »
Hi, this utility looks promising for your use case: https://exiftool.org/

Also, as a best practice, it’s a good idea to import files to PM with the as-captured file names, and write that value into an IPTC Metadata field like ‘Extended Description’ using the {fbas} variable.  That way, you can always revert to the original file name with a simple renaming string vs. trying to recover it from EXIF data.

Offline ahoward

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 994
    • View Profile
Re: Revert camera filename back to original filenames prior to import
« Reply #2 on: November 25, 2024, 12:15:30 PM »
Hi,

I would like to restructure my library and revert my filenames back to the original filenames prior to importing onto computer. I always amend the filenames when importing and now cannot figure out a way to basically reset them back to their 'raw' default filenames.

I have tried various things but both Adobe Bridge and Lightroom just have an original filename option but this is AFTER import which does not solve my problem. Can Photo Mechanic help me?

Regards
Catherine

If the filename was changed and there was nothing done to retain the original at the time that the name was changed, then the original filename is gone. The information would need to be stored somewhere in order for Photo Mechanic (or exiftool, for that matter) to know what to revert the filenames too.  Robert's suggestion of using the {fbas} variable in some metadata field upon Ingest is a good one, as Photo Mechanic does not do anything automatically to hang on to a previous filename.

Offline ahoward

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 994
    • View Profile
Re: Revert camera filename back to original filenames prior to import
« Reply #3 on: November 25, 2024, 12:16:33 PM »
Hi, this utility looks promising for your use case: https://exiftool.org/

Also, as a best practice, it’s a good idea to import files to PM with the as-captured file names, and write that value into an IPTC Metadata field like ‘Extended Description’ using the {fbas} variable.  That way, you can always revert to the original file name with a simple renaming string vs. trying to recover it from EXIF data.

Just to note, you can rename on Ingest while using {filenamebase} to store the original filename in the metadata of each image.

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 557
    • View Profile
    • Camera Bits
Re: Revert camera filename back to original filenames prior to import
« Reply #4 on: November 25, 2024, 12:40:59 PM »
The metadata may still contain the frame number, in which case if you tried renaming with the string

Code: [Select]
DSC_{frame4}
(or whatever prefix your camera uses, IMG_ etc.) you can get it that way. Try a test on some files and see if that gives you what you need?

Also, you said that you've included the old name as part of the new filename? If so, if you give us an example of your current file names, we might be able to suggest a way to use some "substring extraction" to  get the original filename back 

https://camerabits.freshdesk.com/support/solutions/articles/48001077381-variable-substring-extraction

There may be ways that you can do it with PM.

-Mick

Mick O
Camera Bits

Offline Robert Edwards Media

  • Newcomer
  • *
  • Posts: 14
    • View Profile
    • Robert Edwards Media
Re: Revert camera filename back to original filenames prior to import
« Reply #5 on: November 26, 2024, 09:34:34 AM »
I tested the exiftool utility this morning with Nikon 14-bit raw files for the Z9 (HE* .NEF) and D5 (Lossless Compressed .NEF):

TL/DR:
-   The original file name IS NOT present. 
-   The original file name suffix (‘File Number’) value IS present. 
-   See attached file rows 3 and 321, for reference.

Details:
If the OP uses a standard prefix in their as-captured file naming (in the above example, “Z9A_” or “D5A_”) they could reconstruct the original file names by concatenating that prefix + the EXIF value shown in ‘File Number’ field:

Z9A_ + 1591 = Z9A_1591     

If the shoot contains images from multiple cameras, they can derive the proper file name prefix from the ‘Serial Number’ in row 345.

Can also do this directly in PhotoMechanic by reading {snum}, translating that to the file name prefix (example: "Z9A_"), and then concatenating {frame}.

HTH