Strange behaviour using -ex with multiple subjects

Started by ARK, November 26, 2021, 08:43:49 AM

Previous topic - Next topic

ARK

Hi, I'm using exiftool for over a year to handle my archive of images. Today I stubbled over a strange behaviour when using escape characters. I installed a fresh version 12.36 but it still happens.

1. Take an xmp file without subjects, e.g.
exiftool -ex -p '$subject' D079_08.xmp
Warning: [Minor] Tag 'subject' not defined - D079_08.xmp

2. Add a subject with apostrophes:
exiftool "-subject+=Rock'n'Roll" D079_08.xmp
exiftool -ex -p '$subject' D079_08.xmp

Rock'n'Roll
This is as expected and identical to the content of the xmp file.

3. Add another subject :
exiftool "-subject+=Karneval" D079_08.xmp
exiftool -ex -p '$subject' D079_08.xmp

Rock'n'Roll, Karneval

Suddenly there are & in the output. What is going wrong?

Best regards,
Armin


Phil Harvey

Hi Armin,

The -ex option formats the output in XML.

The -p option is user-specified formatting.

These options are not compatible.

- 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 ($).

ARK

Hi Phil,

thanks for the insight. I've rewritten my script in perl using the exiftool interface ;)
And of course thanks for the superb tool!

Armin