ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: ARK on November 26, 2021, 08:43:49 AM

Title: Strange behaviour using -ex with multiple subjects
Post by: ARK on November 26, 2021, 08:43:49 AM
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

Title: Re: Strange behaviour using -ex with multiple subjects
Post by: Phil Harvey on December 04, 2021, 10:54:52 AM
Hi Armin,

The -ex option formats the output in XML.

The -p option is user-specified formatting.

These options are not compatible.

- Phil
Title: Re: Strange behaviour using -ex with multiple subjects
Post by: ARK on December 06, 2021, 04:43:40 PM
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