Need to modify DateTimeOriginal by CreateDate

Started by mlwalpert, July 15, 2020, 03:18:09 PM

Previous topic - Next topic

mlwalpert

Hi,

I am trying to edit a batch of images that have an incorrect DateTimeOriginal tag. The CreateDate tag is correct, so I want to overwrite DateTimeOriginal with CreateDate.

I've tried everything that I've found online, and none of it has worked.

Ex:
[exiftool "-CreateDate<DateTimeOriginal" FILE]
[exiftool "-FileModifyDate<CreateDate:DateTimeOriginal" -d %Y:%M"%D_%H:%M:%S FILE]
[exiftool  -exif:DateTimeOriginal=CreateDate FILE]
[exiftool -AllDates<CreateDate FILE]

There are various other iterations, but that's basically the gist.

Can anybody help me figure out what I'm missing?

Thanks


StarGeek

What program are you using to look at to see the "CreateDate"?  If it's not exiftool, then you should know that not all programs call tags by the same name.

Run this command to see all the time stamp tags
exiftool -time:all -g1 -a -s /path/to/files/

Figure out which of those tags is the one you want to copy from and then replace TAG with that name in this command
exiftool "-DateTimeOriginal<TAG" /path/to/files

* 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).

mlwalpert

Thanks for the reply.

I'm running exiftool in the Windows Command Prompt. Once I get it working for a single file, I'll write a batch script to make it work on a full directory.

I ran the scripts you suggested
[/exiftool -time:all -g1 -a -s */P3410341.JPG]

Output:

FileModifyDate                  : 2020:07:13 11:35:17-05:00
FileAccessDate                  : 2020:07:15 14:02:37-05:00
FileCreateDate                  : 2020:07:15 12:44:50-05:00
ModifyDate                      : 2020:07:13 11:35:17
DateTimeOriginal                : 1969:12:31 18:02:04
CreateDate                      : 2020:07:13 11:35:17
SubSecTime                      : 677000000
SubSecTimeDigitized             : 677000000
DateTimeOriginal                : 2020:07:13 12:35:17.677000-04:00
CreateDate                      : 2020:07:13 12:35:17.677000-04:00
ModifyDate                      : 2020:07:13 12:35:17.677000-04:00
Date                            : 2020:07:13 12:35:17.677000-04:00
DigitalCreationDate             : 2020:07:13
SubSecCreateDate                : 2020:07:13 11:35:17.677000000
SubSecModifyDate                : 2020:07:13 11:35:17.677000000

I see here that there are 2 DateTimeOriginal fields; one has the correct date, the other says that it's 1969. I need to change the one that says the year is 1969.

So I tried running
[/exiftool "-DateTimeOriginal<CreateDate" */P34103341.JPG]

Output:

Warning: Bad MakerNotes offset for tag 0x0013 - p3410341.jpg
Error: [minor] Bad MakerNotes offset for Unknown_0x0013 - p3410341.jpg
    0 image files updated
    1 files weren't updated due to errors


I've been getting that error a lot today.

StarGeek

That output is incomplete.  There are supposed to be group names so we can figure out exactly where the problem is .  For example
C:\>exiftool -time:all -g1 -a -s y:\!temp\Test4.jpg
---- System ----
FileModifyDate                  : 2020:07:07 08:35:22-07:00
FileAccessDate                  : 2020:07:07 08:35:22-07:00
FileCreateDate                  : 1979:12:31 01:01:01-08:00
---- IFD0 ----
ModifyDate                      : 2020:07:13 15:43:18
---- ExifIFD ----
DateTimeOriginal                : 2020:07:13 15:43:18
CreateDate                      : 2020:07:13 15:43:18


From the sound of it, the extra DateTimeOriginal is probably in the MakerNotes.  As long as the file isn't a RAW file type, you could try running the command in FAQ #20 or you could add the -m (ignoreMinorErrors) option (see FAQ #15).

There might be damage to the MakerNotes and some of that data may be lost if you try and fix it or it may already be lost, so make sure you have backups just in case.
* 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).

mlwalpert

Ok so I must have made a mistake somewhere in the command I typed. I tried again and got the result below.

---- System ----
FileModifyDate                  : 2020:07:15 16:00:46-05:00
FileAccessDate                  : 2020:07:15 16:00:45-05:00
FileCreateDate                  : 2020:07:15 16:00:45-05:00
---- IFD0 ----
ModifyDate                      : 2020:07:13 11:35:17
---- ExifIFD ----
DateTimeOriginal                : 1969:12:31 18:02:04
CreateDate                      : 2020:07:13 11:35:17
SubSecTime                      : 677000000
SubSecTimeDigitized             : 677000000
---- XMP-dc ----
Date                            : 2020:07:13 12:35:17.677000-04:00
---- XMP-exif ----
DateTimeOriginal                : 1969:12:31 18:02:04
---- XMP-xmp ----
CreateDate                      : 2020:07:13 12:35:17.677000-04:00
ModifyDate                      : 2020:07:13 12:35:17.677000-04:00
---- IPTC ----
DigitalCreationDate             : 2020:07:13
---- Composite ----
SubSecCreateDate                : 2020:07:13 11:35:17.677000000
SubSecModifyDate                : 2020:07:13 11:35:17.677000000

mlwalpert

I think my pre-processing is doing something that prevents me from making the correct edit

When I ran the -time:all script on the original image, all dates/times were correct

When I ran the script on the one I'm trying to fix, I get the one from 1969.

I tried doing a copy using -TagsFromFile, and it failed to do even that.

I keep seeing an error that says

"Bad MakerNotes offset for Unknown_0x0013 - P3410341.JPG"

Could that be my problem?

StarGeek

Yeah, that's probably it.  See FAQ #15 for details on why it's probably happening.

Try running the command on a copy with the -m (ignoreMinorErrors) option.  You may lose some of the MakerNotes but as long as it isn't a raw file, it should be ok.
exiftool -m "-DateTimeOriginal<CreateDate" FILE.jpg
* 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).

mlwalpert

That totally fixed it! Thanks so much!

Now it's giving me an error that says "Unsupported Flir FFF version" (Flir Thermal Studio is the program that messed up the date in the first place--absolutely horrendous piece of software) but that doesn't seem to have any negative effects.

So I'd call that a win.

Thanks again

StarGeek

I'd check to make sure it can be loaded properly by Flir Thermal Studio.
* 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).

mlwalpert

It was produced by Flir in the first place. And the original imagery seems to work fine in the program. Anyway, my problem is solved so I'm happy. Thanks again

Phil Harvey

If you can send me a sample I'll look into adding support for this.  (philharvey66 at gmail.com)

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

Phil Harvey

I got the sample.  The problem is definitely that he maker notes were written incorrectly.  It looks like they were truncated and most of the tag values are missing.  The -m option is definitely the way to go here because I doubt that the makernote information may be saved.

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