• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

How to rename files and write old filename into IPTC oder EXIF data

Explorer ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

hallo everybody!

i need to rename my files with a consecutive number, but i need to keep the old filename too. the archive software i export to is "augias" and it can read iptc or exif data. so i was wondering if there is a way to write the old filename into an iptc or exif field. with lighroom or if necessary some other software.

to be more specific about my filenames:

out of the camera the filenames have these names:
asdf_0651, asdf_0652 and so on

when i import to lightroom, i rename them to 20221101asdf117, 20221101asdf118 and so on

 

after that i choose some files to export them to the archive, and they need to be renamed with a consecutive number like this:


20221101asdf117 ----> 1
20221101asdf121 ----> 2
20221101asdf176 ----> 3

so the filename i want to write into the metadata is not the "original" filename (asdf0651) but the main filename 20221101asdf117

for now i have to do this by hand 😞

thanks in advance for any help!

TOPICS
Cross-app workflows , Windows

Views

892

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 20, 2022 Nov 20, 2022
quote

thats great! do you have any idea how to write "preserved filename" into an iptc field?


By @toklas

 

Have a look at this LrC plug-in from John Beardsworth, that may allow you to copy the data in the Preserved Filename field to one of the IPTC fields, so you could do that before exporting: http://lightroomsolutions.com/plug-ins/search-and-replace/#:~:text=Search%20Replace%20Transfer%20is%20a,before%20or%20after%20existing%20text

Likes

Translate

Translate
Community Expert ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

If you rename within LrC - NOT during import - the old filename gets registered to the metadata and is available/visible.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 16, 2022 Nov 16, 2022

Copy link to clipboard

Copied

Hi!
thanks for your reply.
i cant reproduce what you said. when i rename in LR to "1", i see the "original filename" the file had in the camera. (asdf_0651), but not the one i gave the file in LR (20221101asdf117).
thanks for clarifying!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

Ohh ... they changed the behavior! I just double-checked with old imports and new ones with current version of LrC.
I never looked at that for maybe years.

 

Here's how it was: If you renamed during the import, then the original filename field was not populated and the original file name from the camera was gone for good.

If you then renamed "again", the name you renamed to during the import was written to the original filename field and could also be restored. If I understand you correctly, that is actually what you want, right?

 

Here's how it is now on my end: During first import with rename, the original name from camera now is registered as the original name! And it is not overwritten if you rename again.

 

That said, it looks like you're out of luck.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

I don't uderstand the problem. There is a standard rename template in the Export dialog which is "Filename - Sequence", which does exactly what you want, i.e. uses the current filename (not the "original filename, that's a separate option) and adds a sequence number. If you don't want the spaces and the hyphen before the sequence number, simply choose the Edit option and make whatever changes you like then save as a new template for subsequent re-use. Just make sure you select "Filename"

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

hi! thanks for your description of an alternative workflow. but i need the old filename to be written into the metadata. it doesnt help me, if the old filename ist part of the new filename. its not my choise, but those are the conventions of the institution i m working for.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

So use the "Original Filename" when renaming during export. See these screenshots when importing an image that I originally renamed during import to add the capture date:

 

If I use "Filename" in the rename template editor:

 

Filename_Template_Editor_and_Export_One_File.png

 

But when I use "Original Filename" I would get this:

 

Original.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

thanks! but i dont realy understand the screenshots. whre in the metadata will i find the old filename? i need it to be somewhere in the iptc or exif data.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

OK, sorry. I thought you were simply trying to export with the original filename. 

 

However, if you export an image that was originally renamed in LrC, and you include all metadata in the export settings, you should find that the pre-import filename IS retained and included in the metadata in the "Preserved Filename" field. Be aware, however, that LrC only shows this preserved filename when using the "Default" metadata view. See here:

 

Screenshot_20_11_2022__12_36.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

thanks again. yes, i found that. unfortunatly the field "preserverd file name" seems to be only in LR? i would need the value somewhre in the iptc or exif data in order for the "augias" archive software do make use of it.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

No, it's not "only in LR"....if LrC can see it, that means it's in the metadata somewhere. Try using something like ExifTool to view the entire metadata area.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

Here's a screenshot taken using Jeffrey Friedl's Metadata Viewer plug-in, which is powered by ExifTool and shows just about every single bit of metadata in any file.....which is way way more than LrC will show. You can see that the Preserved File Name is most definitely in the metadata section of the exported file.

 

_Users_jimmacmini_Desktop_Export_20221111_JWR55941_jpg.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

thats great! do you have any idea how to write "preserved filename" into an iptc field?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

quote

thats great! do you have any idea how to write "preserved filename" into an iptc field?


By @toklas

 

Have a look at this LrC plug-in from John Beardsworth, that may allow you to copy the data in the Preserved Filename field to one of the IPTC fields, so you could do that before exporting: http://lightroomsolutions.com/plug-ins/search-and-replace/#:~:text=Search%20Replace%20Transfer%20is%...

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

that looks promising, thank you so much!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 22, 2022 Nov 22, 2022

Copy link to clipboard

Copied

LATEST

it works 🙂 thank you!

it is just important to remember, that LR doesnt write the old filename into the "orignal filename" field, when you rename during export (wich is disapointing). but it does so, when you rename beforehand (library/rename... it works with a batch of photos).
the search and replace tool allows you to write the value for "original filename" into an iptc field of your choise.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

quote

so the filename i want to write into the metadata is not the "original" filename (asdf0651) but the main filename 20221101asdf117

 

Obviously I was confused by this!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

Your requirement of the metadata "original" filename to show something non-original, is a little unusual IMO.

 

Typically it's the before-import naming that people want to preserve no matter what - AFAICT that is what LrC assumes. 

 

So one tactic is to use a renaming utility on the files before import. There's then no need for any renaming at import or subsequently; hence the "original filename" and the current filename seen within LrC will naturally match. Your later export would preserve this metadata while its filename would get a suffix of the appropriate sequence number.

 

Another tactic may be: don't rename the camera original file at all. Your export renaming can prefix the date of capture (working from image metadata) and also suffix a sequence number. In the postprocessing section of the export dialog you can then call Exiftool with a command-line instruction that suitably updates the "original filename" metadata field within the output. For example: to show the exported filename with the sequence suffix stripped off; or else, to prefix the "original filename" with the date of capture, without adding any sequence suffix. AFAIK exiftool is not going to be able to add that varying suffix across a batch - I believe it will consider each image separately and singly. 

 

I suppose there's also the option of a file renaming utility adding this sequence number after export. In any case the main working image within the Catalog is never going to 'know' about this.

 

Anything like this takes a bit of effort to research, set up and test - but that effort pays for itself many times over. The separate use of another utility beforehand does add some extra steps, with possibility of pilot error, onto each future import. OTOH a more complicated export (once that's encoded into an export preset for repeatability) can do its job with zero extra work, zero extra risk of pilot error, on your part.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

hi! thanks for your long answer. i m not familiar with exiftool so far. i will definetly check it out. just a quick question: is ist possible to write an old filename while renaming into an iptc or exif field?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

Exiftool can take attributes of an image including the content of its metadata fields, and use those to update the image in various ways (or to make a modified copy of that).

 

As an example: a copy of the Exiftool utility including commandline options within its file name as below, adds the "specialtag" keyword into the EXIF of an image file, saves the changes to the same file, then exits. You can drag-drop a file (or many files) onto this application icon and that changes those files accordingly. You can also invoke the same kinds of actions as postprocessing to a LrC export.

 

richardplondon_0-1668955982062.png

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

thanks, that sounds promising

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

to be more specific: "augias" can read iptc or exif data, not any metadata. so when renaming the files, i need the old filename to be written into an iptc or exif field. i m aware that lightroom can write old filenames "somewhere" into the metadata, but this value is not one that the software "augias" that i have to use, can read out.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines