This is exiftool FAQ #3. Because you haven't included the -G
(-groupNames
) option and the -a
(-duplicates
) option, you aren't seeing all the data. When you include those options you'll see this
C:\>exiftool -G1 -a -s -DateTimeOriginal Y:\!temp\aa\bbb\DSC02102.JPG
[ExifIFD] DateTimeOriginal : 2021:12:07 15:55:24
[IFD0] DateTimeOriginal : 50 48 50 49 58 49 50 58 48 55 32 49 53 58 53 53 58 50 52 0
As you can see, there is more than one DateTimeOriginal
tag in the file. The standard place for that tag is in the ExifIFD
subgroup of the EXIF block and that has the correct value, which is why Windows can read it. The second DateTimeOriginal
in the IFD0
subgroup is out of place. If you convert each number in the second tag to the ASCII character, you'll see that it holds the same value as the correct DateTimeOriginal
tag, just in hex values.
Another useful exiftool command would be to validate the file to see what problems exist
C:\>exiftool -g1 -a -s -warning -validate Y:\!temp\aa\bbb\DSC02102.JPG
---- ExifTool ----
Warning : [minor] Possibly incorrect maker notes offsets (fix by 4088?)
Warning : [minor] Suspicious MakerNotes offset for Tag9401
Warning : [minor] Non-standard ExifIFD tag 0xea1c Padding
Warning : [minor] Non-standard ExifIFD tag 0xea1d OffsetSchema
Warning : Non-standard format (int32s) for GPS 0x0005 GPSAltitudeRef
Warning : Wrong IFD for 0x9003 DateTimeOriginal (should be ExifIFD not IFD0)
Warning : Non-standard format (int8u) for IFD0 0x9003 DateTimeOriginal
Warning : [minor] Invalid date/time format for EXIF:DateTimeOriginal
Warning : Wrong IFD for 0x9004 CreateDate (should be ExifIFD not IFD0)
Warning : Non-standard format (int8u) for IFD0 0x9004 CreateDate
Warning : [minor] Invalid date/time format for EXIF:CreateDate
Warning : [minor] Non-standard IFD0 tag 0xea1c Padding
Warning : Missing required JPEG ExifIFD tag 0xa001 ColorSpace
Validate : 13 Warnings (7 minor)
You can remove the incorrect tag with this command
exiftool -IFD0:DateTimeOriginal= file.jpg
To extract just the correct tag, you would have to specify the subgroup
exfitool -ExifIFD:DateTimeOriginal file.jpg