How to add missing EXIF date

Started by risbac, January 01, 2024, 12:34:34 PM

Previous topic - Next topic

risbac

Hello !

Sorry I have a very silly issue. i'm trying to fix an issue with photos appearing at the wrong date on my Synology application. There are no tag in the EXIF group in the photo, so it's taking the date of file modification. I have the date in the XPM-exif group, but I can't copy it in the EXIF tag as it doesn't exist. I have tried

exiftool -overwrite_original "-alldates<${XMP-exif:DateTimeOriginal}" *.jpg

but I get a "Warning: No writable tags set".

Is there any way to create the missing tag ? Thanks for any feedback !

wywh

#1
Your command works for me (with both double and single quotes) if there indeed is XMP-exif:DateTimeOriginal tag.

Also this works:

exiftool -m -P -overwrite_original -ext jpg -ext png -ext tif -if 'not $ExifIFD:DateTimeOriginal' '-AllDates<XMP-exif:DateTimeOriginal' .
exiftool -a -G1 -s -Time:All .
======== ./image.jpg
[XMP-exif]      DateTimeOriginal                : 2001:01:01 12:00:00-05:00

exiftool -m -P -overwrite_original -ext jpg -ext png -ext tif -if 'not $ExifIFD:DateTimeOriginal' '-AllDates<XMP-exif:DateTimeOriginal' .
    1 directories scanned
    1 image files updated

exiftool -a -G1 -s -Time:All .
======== ./image.jpg
[IFD0]          ModifyDate                      : 2001:01:01 12:00:00
[ExifIFD]       DateTimeOriginal                : 2001:01:01 12:00:00
[ExifIFD]       CreateDate                      : 2001:01:01 12:00:00
[XMP-exif]      DateTimeOriginal                : 2001:01:01 12:00:00-05:00

- Matti

StarGeek

As wywh says, your command requires the existance of XMP-exif:DateTimeOriginal, but that is not a common tag to exist outside of XMP sidecar files.

Use this command to see all the time stamps in the file and use one that already exists.
exiftool -time:all -G -a -s /path/to/files/

Also, I always advise keeping the tag names as simple as possible.  Only adding the group names if absolutely necessary.  So when copying it would be preferable to copy from DateTimeOriginal instead of XMP-exif:DateTimeOriginal. My previous post on keeping it simple.
"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

risbac

Thanks Matti, it works indeed ! I can fix my photos.

StarGeek, thanks for your comment. I didn't explain it clearly enough. The XMP date, I have it on all those photos. It's the EXIF tags that are absent from the jpg. The XMP date is the only one I can use, I had used your command to find all the available dates, and no other choice : source must be XML, and destination must be EXIF. Matti's solution is working, I can fix those photos this way.

Thanks for your time to help me !