Renaming .JPEG pictures from file name and updating .exif

Started by thattallkid, February 21, 2022, 05:08:51 AM

Previous topic - Next topic

thattallkid

I am very new to this tool and can't seem to get much to work due to my lack of knowledge!

I've been using a few tools to clear up my photo library and now have it where almost all of the file names of my photos are correct. Some of this came from tagging from EXIF data in other apps etc. and some from taking out spaces / characters from the original file name. Now all of the files read something like this: 2006_08_28_18_43_38

All looks good within Windows Folders but when I go into other programs (still using Picasa often) the order is not right and I guess that is because the file name is changed but not the EXIF date. How can I batch edit (12,000 pictures) so that the EXIF data (ideally all of date created / modified / taken etc.) are set from the file name? I am thinking that if change multiple of this EXIF data points, then irrelevant of what photo program I use, the photos should all read in correct chronological order.

Many thanks and for simple explanations as I try to get my head round how this powerful tool works! Many thanks.

wywh

Try this when you are in a folder with such .jpg files (make a backup of the folder first, just in case). You might have to substitute ' with " if you are using Windows:

exiftool -overwrite_original_in_place '-AllDates<filename' '-FileCreateDate<filename' '-FileModifyDate<filename' .

Leave out '-FileCreateDate<filename' '-FileModifyDate<filename' if you don't want to modify them.

-AllDates is a Shortcut to 'DateTimeOriginal', 'CreateDate' and 'ModifyDate':

exiftool -a -G1 -s -time:all -api RequestAll=2 2006_08_28_18_43_38.jpg
[System]        FileModifyDate                  : 2006:08:28 18:43:38+03:00
[MacOS]         FileCreateDate                  : 2006:08:28 18:43:38+03:00
[IFD0]          ModifyDate                      : 2006:08:28 18:43:38
[ExifIFD]       DateTimeOriginal                : 2006:08:28 18:43:38
[ExifIFD]       CreateDate                      : 2006:08:28 18:43:38
[XMP-xmp]       CreateDate                      : 2006:08:28 18:43:38
[XMP-xmp]       ModifyDate                      : 2006:08:28 18:43:38


In macOS the command asks for Xcode Command Line Tools install which can be ignored but then the FileCreateDate moves only backwards in time (the install is quite small and fast, not the huge Xcode install).

- Matti

thattallkid

Thanks for the reply. I've been watching a few YT videos but still can't get my head around how to start and where to input the command you said sorry!

I've copied the files (12000 in total) and got the .exe file in the same folder. I then open ExifTool from cmd. menu but then not sure what next step is. I tried dragging the 12000 files into the ExifTool cmd / black screen but not getting far with that.

Many thanks.


Phil Harvey

1. Open "cmd.exe"

2. Drag and drop "exiftool.exe" onto the cmd window.

3. Press SPACE in the cmd window.

4. Type this in the cmd window:

    -overwrite_original "-AllDates<filename" "-FileCreateDate<filename" "-FileModifyDate<filename"

5. Press SPACE again in the cmd window.

6. Drag and drop the file or folder containing the images onto the cmd window.

7. Press RETURN in the cmd window.

Done.
...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 ($).

thattallkid

Thanks so much! Getting that working now and making some good changes, so so useful :)

Getting a lot of errors though as it is going through all of the files...

I previously used "Bulk Rename Utility" to take all of the realistic looking dates (some were date created, some were date modified, some were date taken) to then create the filename. The rest (this original question) already had the date but no EXIF data. It seems some are still wrong though (wrong time of day etc.) I also got recommended jExifToolGUI which I am looking through now, I see many dates within the EXIF data (often up to 5 - 6 different ones) any ideas on which are the most accurate and then maybe I try to find the cmd to change all to that!

Many thanks again, the ExifTool is currently working through the 12000 files and then will input back to Picasa and see how that works with now the EXIF data matching the filename :)


thattallkid


This has worked so well, thanks a lot!

I am now just having this issue where "file date" is not updating. All the others have, but in Picasa it groups pictures by "file date" as in the picture below so even though I am 99% of the way there. Still not quite there unfortunately.

Any ideas? Thanks

Phil Harvey

Run this command on the file to see if you can find the date/time tag that needs changing:

exiftool -a -G1 -time:all FILE

- 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

I'd guess it's one of the file OS timestamps, FileCreateDate/FileModifyDate.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

thattallkid


Thanks again, unfortunately as this picture shows, it doesn't show up.

All suggests that is taken on 31/12 (correct) apart from the middle lower red circle which still shows "file date" and also the RHS red circle which is what the program seems to categorise pictures by.

Phil Harvey

Well, if the date/time is in the file then it isn't in one of the standard locations (also, the formatting is non-standard).

Either that, or Picasa maintains a database external to the file that contains this date/time.

But without seeing the file, I can't tell.

- 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: Phil Harvey on March 11, 2022, 08:44:47 PMEither that, or Picasa maintains a database external to the file that contains this date/time.

It's probably this.  Try moving the file to a different directory which Picasa doesn't index, make sure it updates that folder so it's no longer in the database, and then put it back.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

thattallkid

Really useful, thanks a lot and will get to that when back.

Doing a similar thing with videos (all file name are correct and now trying to get EXIF data to match. Getting this error below for most of the video files (still is in process of going through the files, so not sure if the EXIF data will match the filename despite this 'minor warning.')

"Warning: [minor] The ExtractEmbedded option may find more tags in the media data - E:/OneDrive/Pictures/Video/Done/2020_05_22_05_13_47.MOV"

Thanks again. My OCD with these filenames is getting a lot closer to satisfied :)

StarGeek

Quote from: thattallkid on March 12, 2022, 04:28:33 AM
Getting this error below for most of the video files (still is in process of going through the files, so not sure if the EXIF data will match the filename despite this 'minor warning.')

"Warning: [minor] The ExtractEmbedded option may find more tags in the media data - E:/OneDrive/Pictures/Video/Done/2020_05_22_05_13_47.MOV"

That's not an error.  It's just a message to let you know that there may be more metadata in the file that isn't extracted at that time.  For example, an embedded GPS log might be there which you would have to add the -ee (-extractEmbedded) option in order to see it.

One other thing to be aware of with videos is that the CreateDate is supposed to be set to UTC.  See the fourth paragraon on the Quicktime tags page.  I'm not sure if Picasa will properly read and adjust the time.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype