How to copy DateTimeDigitized into other Datexx tags despite format

Started by dantou, January 23, 2022, 10:57:00 AM

Previous topic - Next topic

dantou

Hello
After a lot of unsuccessful research, I present my problem to you:
In a batch of photos, all the 'Date' tags are the same, but wrong (I specify that DateTimeDigitized is different from CreateDate)
Thanks to Exiftool, I found the 'DateTimeDigitized' tag which is good. But its format is different because it includes 1/10 seconds. By searching on this forum, I found to extract it in the normal format, but my knowledge of Exiftool is brand new and I cannot copy its content into the other 'Date' tags, with an error on the format
ex:
#exiftool "-filename<CreateDate" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r *.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - B_20080624_011.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - B_20080624_012.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - B_20080624_013.jpg
...  it's OK
but replacement of CreateDate by DateTimeDigitized
[dan@localhost 2008-06-24]$ exiftool "-filename<DateTimeDigitized" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r *.jpg
Warning: Error opening file - *.jpg
Error: File not found - *.jpg
    0 image files updated
    1 files weren't updated due to errors
Can anyone help me ?
Thank you.

StarGeek

There really shouldn't be any problem if the command is exactly the same except for the change in date tag.  So something else must be happening.

Try this instead.  Use a dot to represent the current directory and add the -ext (-extension) option to limit processing to jpgs
exiftool "-filename<DateTimeDigitized" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r -ext 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).

dantou

Oh !!!! I am sorry. What I put as an example is a bad try I was doing to get around my problem. But your solution is perfect for what follows. It is indeed the '.xmp' which interfere in the previous example!
In fact, this is what happens:
#exiftool -AllDatesprint.txt *.jpg
======== B_20080624_001.jpg
Date/Time Original   : 2008:06:24 19:18:26
Create Date              : 2008:06:24 19:18:26
Modify Date              : 2008:06:24 19:18:26
All these dates are wrong. Corn :
#exiftool -AllDates -DateTimeDigitizedprint.txt *.jpg
======== B_20080624_001.jpg
Date/Time Original   : 2008:06:24 19:18:26
Create Date             : 2008:06:24 19:18:26
Modify Date             : 2008:06:24 19:18:26
Date/Time Digitized:  2008:06:24 15:20:26.10     >>> here is the correct time, but the format is not the same
so i do
#exiftool -d '%Y:%m:%d %H:%M:%S' -AllDates -DateTimeDigitizedprint.txt *.jpg to get identical formats
======== B_20080624_001.jpg
Date/Time Original    : 2008:06:24 19:18:26
Create Date              : 2008:06:24 19:18:26
Modify Date              : 2008:06:24 19:18:26
Date/Time Digitized  : 2008:06:24 15:20:26         >>> with always the correct time on this single tag

What I want is to put this good hour in the other tags 'Date'
but when i do
#exiftool -AllDatesDateTimeDigitized *.jpg
bash: DateTimeDigitized: No such file or directory
Where
#exiftool -DateTimeOriginalDateTimeDigitized B_20080624_011.jpg
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
Nothing to do.
or
#exiftool -d '%Y:%m:%d %H:%M:%S' -DateTimeOriginal=DateTimeDigitized B_20080624_011.jpg
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
Nothing to do.

What is the correct wording?
Thank you
Dan

dantou

Yes, I've find
exiftool "-AllDates<DateTimeDigitized" *.jpg
but all images are save in '.original'. : B_20080624_001.jpg and B_20080624_001.jpg_original
How avoid this copy

Phil Harvey

The -overwrite_original option avoids preserving the _original files as backups.

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