News:

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

Main Menu

Copy date-related metadata only from original image to extracted thumbnails

Started by Design_is_One, April 18, 2021, 10:23:00 PM

Previous topic - Next topic

Design_is_One

Hi,

First of all, let me thank the whole community and the creators of ExifTool for giving us such a useful instrument!

Now, this is probably a simple problem, but I couldn't find an exact answer, probably because I'm not sure how to search for it!




Problem.
I've successfully extracted thumbnails and previews from a large group of images. All thumbnails and previews lack the original files' dates and times, which makes it impossible to order them correctly. I'd like to copy over the date/time metadata from the original images to the previews and thumbnails.

Issues.

  • I don't know which command can read the date-related metadata and copy it over to the others, similarly named images.
  • Other metadata in the exported images has already been altered (rating, keywords, etc.) and should not be impacted from the copy of the date-related metadata

File names.

       
  • Original images: IMG_1234.tif
  • Previews: IMG_1234_Preview.tif
  • Thumbnails: IMG_1234_Thumbnail.tif

Folders.
The original images, the thumbnails, and the previews are all in separate folders.

       
  • Original images: Originals
  • Previews: Previews
  • Thumbnails: Thumbnails

OS.
macOS.




Any help is welcome as I'm willing to give this a go before editing thousands of images by hand!
Thank you :)

Phil Harvey

Here is a command that should do what you want:

exiftool -tagsfromfile Originals/%8f.tif -datetimeoriginal -createdate Previews Thumbnails

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Design_is_One

Quote from: Phil Harvey on April 19, 2021, 07:06:15 AM
Here is a command that should do what you want:

exiftool -tagsfromfile Originals/%8f.tif -datetimeoriginal -createdate Previews Thumbnails

- Phil

Oh wow, thank you so much Phil! That did work indeed :D
Out of curiosity,  if I run the command exiftool -G -CreateDate -a Thumbnail/IMG_1234_Thumbnail.tif I only see the [EXIF] data, while the original image seems to also have [XMP] data. I know very little about it: is this important for me if I use Adobe LightRoom?
Also, when looking at the operating system's info the "date created" does not seem updated. Do you know if this is expected and normal? :)

Thanks again!

Phil Harvey

Use this to see all date/time information:

exiftool -time:all -a -G -s FILE

And see here for what Windows displays.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: Design_is_One on April 19, 2021, 07:42:00 AM
Out of curiosity,  if I run the command exiftool -G -CreateDate -a Thumbnail/IMG_1234_Thumbnail.tif I only see the [EXIF] data, while the original image seems to also have [XMP] data. I know very little about it: is this important for me if I use Adobe LightRoom?

Adobe should read the EXIF timestamps.  You can try changing -datetimeoriginal -createdate to -All:Alldates and it should copy the three major timestamps in both EXIF and XMP.  Or you can experiment and try -Time:All and check those results.  But I'd suggest testing the latter first.  I don't believe there would be any unforeseen problems, but you never know.

QuoteAlso, when looking at the operating system's info the "date created" does not seem updated. Do you know if this is expected and normal? :)

That's probably the file system timestamp.  They're not the best to rely on because if  the file is modified then they're supposed to change.  You can copy those as well by adding this to the command
-FileCreateDate -FileModifyDate
* 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).

Design_is_One

Thank you both so much for the help! I used exiftool -tagsfromfile Originals/%8f.tif -All:Alldates Previews Thumbnails and it worked perfectly! Lightroom is now showing the photos all neatly ordered by date! thank you! :)
Would you know if I can use the same command for videos as well? They're in different formats though: the sources are all in .MP4, but the destination ones are in different formats: .MP4, .M4V, and .MOV  ???

Thank you *SO*, *SO* much!!! :)
(You are amazing human beings)

StarGeek

Test it on some files to see, though you might have to change the %8f.tif part if the original filenames are a different pattern (see the -w (-TextOut) option for details).  And you'd have to change .tif to .mp4.
* 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).

Design_is_One

Thank you again! I tried and, while exiftool clearly did the job, LightRoom didn't want to read the updated metadata this time. Not a big issue as I had only about 20 files and I updated their creation date manually. Weird though!
Anyway, I wanted to thank you all for the help! You've been really kind :)

StarGeek

You might try using just -Alldates instead of -All:Alldates.  Removing the All part will allow exiftool to copy tags to other groups instead of an exact group copy.  In the case of video files, that means that it will copy to the XMP timestamps, which is what Lightroom will read.
* 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).

Design_is_One

Thank you again StarGeek! Unfortunately I already changed all dates manually in LR so I didn't get a chance to try out your command  :-[ But maybe you can help me with the next step of the restoration of these videos...

Is there a way to update the camera "make" and "model" for videos?
I tried with the following command and, while it certainly did execute, it corrupted all the videos and had to restore them:

exiftool -model='Canon PowerShot G16' -make='Canon' VideosTemp

Note: the sources are all in .MP4, but the destination ones are in: .MP4, .M4V, and .MOV

Thank you so much!

StarGeek

Quote from: Design_is_One on April 22, 2021, 09:36:54 PM
Is there a way to update the camera "make" and "model" for videos?
I tried with the following command and, while it certainly did execute, it corrupted all the videos and had to restore them:

Exiftool shouldn't corrupt videos.  It would be very worrying for that to happen.  Do you have a sample you can make available in case Phil wants to check it out?  There was no problem with my test video.

As for Make and Model, it all depends upon how they're going to be used and read.  The EXIF Make and Model tags are non-standard in video files and exiftool can't write that.  There's Quicktime Make/Model tags, but I have doubts about those being read by any program.  Lightroom would probably read XMP:Make/XMP:Model.

So all the options would be (UserData and Keys are Quicktime)
-UserData:Make=Make
-Keys:Make=Make
-XMP-tiff:Make=Make

-UserData:Model=Model
-Keys:Model=Model
-XMP-tiff:Model=Model
* 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).

Phil Harvey

Quote from: Design_is_One on April 22, 2021, 09:36:54 PM
I tried with the following command and, while it certainly did execute, it corrupted all the videos and had to restore them:

More details are necessary.  Could you upload a sample video so we can reproduce this problem?

If ExifTool corrupts videos, it needs to be fixed.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Design_is_One

Hey Phil and StarGeek, thanks again for all your answers.
I tried using the -XMP-tiff:Make=Make and -XMP-tiff:Model=Model, with no effect in LightRoom (didn't even see that the metadata had changed). In the end I resolved by changing the camera model from within the LightRoom's Metadata window.
In regards to the corruption of the videos I just wanted to add that unfortunately I cannot share these videos as they're sensitive unpublished work that I cannot share. But, I meant to elaborate by saying that it was within LightRoom that the corruption became apparent: LR displayed a black round icon with an exclamation mark on the top right corner of the videos, saying that there was an error with them and LightRoom was not able to play them.
In the previous comments I left the exact command I used, in case you wanted to experiment with it.
I'm sorry of not being in a position of being able to help more. I hope this helps! Thanks again.

Phil Harvey

Can you tell us what type of video it was?  MP4, M4V or MOV?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).