Is the automatic creation and use of xmp sidecars to be expected?

Started by Skids, February 14, 2025, 05:32:22 AM

Previous topic - Next topic

Skids

I apologise because I have read the FAQs and some posts and still do not understand how xmp sidecar files are being created and used by exiftool.

My confusion stems from having written a script that writes metadata into raw files.  The exiftool command is of this form:

exiftool -m -r '-XMP:Title<Filename' '-FileName<CreateDate' -d PATH/to/destination/folder/%Y/%Y_%m/%Y_%m_%d_%H%M%S_%%f.%%e PATH/to/source/folder

My actual command writes several more tags but the snip above shows the basics.  This script when run writes the tags into the camera raw files and it works well.

The following script is from an application I am working on and was written to write tags to jpeg, tiff and dng files.  At the moment it is only writing the xmp:subject tag.
exiftool -m '-subject-=Family Friends' '-subject+=Family Friends' FILEPATH.EXT
When tested with a jpeg file the metadata is written into the jpeg as expected.  However, when run on an .ORF file exiftool creates an .xmp sidecar file which is used to store the matadata.  This surprised me as I thought I needed to split my list of image files into three lists depending on type and need or not to create sidecar files.

I read the documentation and gained the impression that I have to specify the creation of sidecar files.  This idea was based on this code snip.

exiftool "-XMP:headline<EXIF:SubSecTimeDigitized" -srcfile %d%f.xmp -ext nef DIR
I interpret this line to mean write the headline tag into an xmp sidecar file for every Nikon nef file in the specified directory.

My question boils down to this, is it safe or proper to pass exiftool a list of mixed image file types and expect exiftool to create and use xmp side car files on the fly as required?

best wishes
Simon

Phil Harvey

Hi Simon,

Quote from: Skids on February 14, 2025, 05:32:22 AMexiftool -m '-subject-=Family Friends' '-subject+=Family Friends' FILEPATH.EXT
However, when run on an .ORF file exiftool creates an .xmp sidecar file

No it doesn't.

QuoteI read the documentation and gained the impression that I have to specify the creation of sidecar files.

Correct.

QuoteMy question boils down to this, is it safe or proper to pass exiftool a list of mixed image file types and expect exiftool to create and use xmp side car files on the fly as required?

ExifTool will not create an XMP file unless you specify an XMP file on the command line directly or with the -srcfile option.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Skids

QuoteExifTool will not create an XMP file unless you specify an XMP file on the command line directly or with the -srcfile option.

- Phil

Thanks.