Skip to main content
Laurent_D
Known Participant
May 28, 2021
Answered

Lightroom change la date de capture au moment de l'enregistrement de mots clés

  • May 28, 2021
  • 3 replies
  • 1719 views

Salut la communauté, j'ai bien vu les posts les plus proches de cette présente question mais je n'ai toujours pas de solution adaptée aux gros volumes à traiter.

 

J'utilise Lightroom pour taguer mes photos, ce qui me permet de les retrouver plus efficacement par la suite soit dans Windows, soit dans Moments (Synology), etc.

L'intérêt est donc que les mots clés soient enregistrés dans le champs correspondant de chaque photo.

Lorsque je demande à Lightroom d'enregistrer les changements, il enregistre les mots clés mais remplace aussi la date de capture par la date du jour.

Il existe des outils qui permettent de modifier la date mais lorsque l'on a des miliers de photos à des dates et heures différentes, cette solution n'est tout simplement pas adaptée.

 

Comment faire pour n'enregistrer que les métadonnées modifiées et non la date de capture qui n'a jamais été modifiée ?

Il n'est pas question ici d'export de nouveaux fichiers mais bien d'écriture dans les fichiers originaux.

 

Au plaisir de vous lire.

This topic has been closed for replies.
Correct answer johnrellis

"It's fortunate that each picture is properly named as follows : aaaammdd_hhmmss.jpg (for instance : 20210607_175459.jpg) So I need to find a script that writes the date/time from the name to the capture date."

 

One approach doesn't require programming: Export as a text file a list of all the file paths using the Any Filter, List View, or LR/Transporter plugins. 

 

1. Select all the photos and do Metadata > Save Metadata To File.

 

2. Use a text editor with regular expressions or Excel (if you're an Excel junky) to transform that list to a list of shell commands invoking the free Exiftool utility to set the files' EXIF:DateTimeOriginal field. E.g. given this line in the text file:

 

/users/john/pictures/20210607_175459.jpg

 

the text editor or Excel formula transforms it to this line:

 

exiftool -exif:datetimeoriginal="2021:06:07 17:54:59" "/users/john/pictures/20210607_175459.jpg"

 

3. Run that shell script / batch file.

 

4. With all the photos selected, do Metadata > Read Metadata From File.

3 replies

johnrellis
johnrellisCorrect answer
Legend
June 7, 2021

"It's fortunate that each picture is properly named as follows : aaaammdd_hhmmss.jpg (for instance : 20210607_175459.jpg) So I need to find a script that writes the date/time from the name to the capture date."

 

One approach doesn't require programming: Export as a text file a list of all the file paths using the Any Filter, List View, or LR/Transporter plugins. 

 

1. Select all the photos and do Metadata > Save Metadata To File.

 

2. Use a text editor with regular expressions or Excel (if you're an Excel junky) to transform that list to a list of shell commands invoking the free Exiftool utility to set the files' EXIF:DateTimeOriginal field. E.g. given this line in the text file:

 

/users/john/pictures/20210607_175459.jpg

 

the text editor or Excel formula transforms it to this line:

 

exiftool -exif:datetimeoriginal="2021:06:07 17:54:59" "/users/john/pictures/20210607_175459.jpg"

 

3. Run that shell script / batch file.

 

4. With all the photos selected, do Metadata > Read Metadata From File.

Laurent_D
Laurent_DAuthor
Known Participant
June 8, 2021

Thankyou again @johnrellis for this great tip. I'm an Excel/vba junky so I may develop the right program that can :

  1. Check if the capture date is the same between capture date and file name (It happens sometimes)
  2. Fix each empty capture date

 

Then I can upload the excel file so that anyone can use it.

I wonder if I check this thread as solved, I may not be able to do so, right ?

johnrellis
Legend
May 28, 2021

Google Translation: "Lightroom changes capture date when saving keywords. 

 

Hi community, I saw the posts closest to this question, but I still don't have a suitable solution for large volumes to process.

 

I use Lightroom to tag my photos, which allows me to find them more efficiently afterwards either in Windows, or in Moments (Synology), etc.

The advantage is therefore that the keywords are recorded in the corresponding field of each photo.

When I ask Lightroom to save the changes, it saves the keywords but also replaces the capture date with today's date.

There are tools that allow you to change the date but when you have thousands of photos at different dates and times, this solution is simply not suitable.

 

How to save only the modified metadata and not the capture date which has never been modified?

There is no question here of exporting new files but of writing to the original files."

johnrellis
Legend
May 28, 2021

It sounds like these photos are missing capture dates stored in their metadata. There are many reasons a photo may be missing a capture date, including: It came from a scanne or an old digital camera, or it was downloaded from an online service that stripped metadata from the photo.

 

When LR imports a photo that is missing capture date in its metadata, LR uses as its capture date the file's date-modified field that is maintained by the operating system.  The file's date-modified changes whenever any app changes the file for whatever reason.  When the date-modified changes, LR immediately notices and sets the photo's capture date in the catalog to that new date-modified.  (This is a horrible product design, but Adobe has never cared about supporting metadata of photos coming from other than modern digital cameras.)

 

So when you change the photo's keywords and then do Metadata > Save Metadata To File (or if you have set the option Catalog Settings > Metadata > Automatically Write Changes Into XMP), LR updates the photo's file with the new keywords and the operating system changes the file's date-modified to "now".  LR notices that and immediately changes the capture date recorded in the catalog to "now".

 

To work around this:

 

1. Make a backup of your catalog (better, make two backups).  LR doesn't let you undo changes to capture date.

 

2. Uncheck the option Catalog Settings > Metadata > Automatically Write Changes Into XMP.

 

3. Select all photos and do Metadata > Edit Capture Time. Immediately click Change All. 

 

These steps record the capture date currently displayed by LR for each photo into the photo's EXIF metadata (where digital cameras record it). Going forward, any changes to the photo won't cause the capture date to change.  Note that step 3 DOES NOT change all the photos to have the same date.

 

 

Laurent_D
Laurent_DAuthor
Known Participant
June 7, 2021

I ran a fews tests checking the before-after for each picture properties and I come back to give feedback.

Since the Edit Capture Time is initially set to "Adjust to a specified date and time", for step 3, I would add :

"Select all photos and do Metadata > Edit Capture Time > Change to file's creation date. Immediately click Change All."

 

Now my problem stays the same because the creation time isn't the right one. It tends to be the time when the OS wrote the file on the hard drive. (Creation time and Modified time are allways the same. Shame)

 

It's fortunate that each picture is properly named as follows : aaaammdd_hhmmss.jpg (for instance : 20210607_175459.jpg)

 

So I need to find a script that writes the date/time from the name to the capture date. This stays my quest and I'm still grateful to this community for having helped me around Lightroom.

Still if someone has it in Python or whatever, please let me know and I'll buy you a beer 😉

 

Best regards,

Laurent

dj_paige
Legend
May 28, 2021

Please state clearly if you are using Lightroom or Lightroom Classic, and the version NUMBER.

 

Please state clearly your operating system version NUMBER.

 

 

Laurent_D
Laurent_DAuthor
Known Participant
May 28, 2021

Thank you for your answer @dj_paige

I'm using Lightroom Classic v.10.2 and Windows 10 v.19.09

Still this issue is the sams whatever version I'm using (earlier versions of Lightroom Classic and Windows 7)

dj_paige
Legend
May 28, 2021

In Windows 10, I see RAW files have not had their creation date changed when I add metadata via Lightroom. For JPGs, the creation date changes, but there is another field in Windows Explorer named "Date Taken", it doesn't show by default but it can be turned on, which does not change when you update the metadata.

 

I am curious, however, why this is an issue. In Lightroom Classic, the capture date does not change when you add metadata, and so photos are always searchable by capture date. In my opinion, I think all searching for photos should be done in Lightroom Classic, and so the issue goes away.