Copying tags from one file to another with modifications

Started by DmitTrix, March 21, 2022, 07:38:43 AM

Previous topic - Next topic

DmitTrix

I'm trying to copy date/time information from one file to another, and increment the time by 1 second. I can do it successfully by running two commands in a row:
exiftool  -tagsFromFile  path/to/source.jpg   -DateTimeOriginal           -ModifyDate           -CreateDate          -overwrite_original  path/to/destination.jpg
exiftool                                     '-DateTimeOriginal+=0:0:1'  '-ModifyDate+=0:0:1'  '-CreateDate+=0:0:1'  -overwrite_original  path/to/destination.jpg


Is there a way to achieve the same with a single command? I try this:
exiftool  -tagsFromFile  path/to/source.jpg  '-DateTimeOriginal+=0:0:1'  '-ModifyDate+=0:0:1'  '-CreateDate+=0:0:1'  -overwrite_original  path/to/destination.jpg
I get no errors/warnings from exiftool, but the destination file lacks the above 3 tags altogether.

I'm running exiftool 12.30 on macOS 12.3

Thanks!

StarGeek

If you're copying from one file directly onto another, you can use the GlobalTimeShift option.
C:\>exiftool -G1 -a -s -DateTimeOriginal y:\!temp\Test3.jpg
[ExifIFD]       DateTimeOriginal                : 2022:03:21 12:00:00

C:\>exiftool -P -overwrite_original -GlobalTimeShift 0:0:1 -TagsFromFile y:\!temp\Test3.jpg -DateTimeOriginal y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -DateTimeOriginal y:\!temp\Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2022:03:21 12:00:01


But if you plan on doing it in batch, you'll have to use two commands.  See here.
"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

DmitTrix

Thanks a lot, -GlobalTimeShift does the trick for my use case (working with individual files).