copy tags from xmp to jpg but only modify original if new data to update

Started by rhatguy, June 02, 2023, 09:08:20 PM

Previous topic - Next topic

rhatguy

I use Mylio as a tool to sync pictures from my phones to my home computer.  I also add metadata such as face tags and GPS coordinates to my photos inside Mylio.  Mylio writes that data to an XMP file and does not update the original image.

I use other software such as Nextcloud/Memories and PiGallery2 to display/browse my images.  Those apps do not support XMP files (only reading faces and gps from the jpg itself) so metadata that I add in Mylio doesn't make it into the other apps that I use.

I'm trying to recursively sync through my entire picture collection regularly and write any metadata that is found in XMP files back to the original images, but I do not want to modify the original file if no NEW metadata exists.  I've found the below command works to recursively copy metadata from the XMP files back into the JPG files, but it seems to modify the JPG every single time, which causes my file syncing apps to resync the files.  For instance, if I run the same command over and over, it modifies all the file every time.  Is there a ways to have exiftool only write if there is a change?

exiftool.exe -r -ext jpg -tagsfromfile %d%f.xmp -all:all c:\test

wywh

Does adding '-wm cg' help? Only create new tags (and avoid editing existing ones).

- Matti

rhatguy

That seems to work like a champ on my small test setup.  I'll continue trying to run it across my larger picture collection.  Thanks for the info.  We can consider this closed.  Thanks!

exiftool.exe -r -ext jpg -tagsfromfile %d%f.xmp -all:all -wm cg c:\test