Reading metadata from accompanying XMP sidecar file

Started by halloleo, October 09, 2021, 09:27:11 AM

Previous topic - Next topic

halloleo

I know how to write explicitly XMP sidecar files with exiftool.

However when reading metadata from an images file I was hoping that exiftool implicitly uses its sidecar file as well, but for me exiftool does not do so. Is there a way to tell exiftool to read metadata from an accompanying XMP sidecar if present?

Thanks for any pointers!

StarGeek

I was about to say no, but then I double checked and saw that this is possible using the -srcfile option.  Learned something new.

Your command would be along these lines
exiftool -srcfile %d%f.xmp -srcfile @ -TAG1 -TAG2 -TAG3 /path/to/files/

Example output
C:\>exiftool -G1 -a -s -Description y:\!temp\Test4.jpg y:\!temp\Test4.xmp y:\!temp\Test3.jpg
======== y:/!temp/Test4.jpg
[XMP-dc]        Description                     : Embedded Description
======== y:/!temp/Test4.xmp
[XMP-dc]        Description                     : Sidecar Description
======== y:/!temp/Test3.jpg
[XMP-dc]        Description                     : Embedded Description, No sidecar
    3 image files read

C:\>exiftool -G1 -a -s -srcfile %d%f.xmp -srcfile @ -Description y:\!temp\Test4.jpg y:\!temp\Test3.jpg
======== y:/!temp/Test4.xmp
[XMP-dc]        Description                     : Sidecar Description
======== y:/!temp/Test3.jpg
[XMP-dc]        Description                     : Embedded Description, No sidecar
    2 image files read


"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

halloleo

That's super cool, @StarGeek! Thanks a lot.

Very smart to have the second -srcfile option (-srcfile @) as a fallback!